Lightning-AI / Lightning-AI/lightning-thunder
Implement max_norm argument for torch.nn.functional.embedding
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
## 🚀 Feature
At the moment, the `max_norm` argument raises a NotImplementedError in Thunder:
https://github.com/Lightning-AI/lightning-thunder/blob/52ee541073ddf6dce78b77ddb272621f712e3c6a/thunder/core/prims.py#L4082-L4088
According to the [documentation](https://pytorch.org/docs/stable/generated/torch.nn.functional.embedding.html) when this argument is active the `weight` argument is modified inplace. Once we improve general support for inplace operators in Thunder we need to come back to this op and support this variant.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in thunder/core/prims.py around the NotImplementedError for embedding's max_norm argument, then read the linked PyTorch embedding documentation to confirm the in-place weight behavior. The work is done when Thunder supports this variant after general in-place operator support is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100