Lightning-AI / Lightning-AI/lightning-thunder
dividing a float16 tensor by a python float is inaccurate with nvfuser
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
The sample case of `test_core_vs_torch_consistency_div_nvfuser_cuda_thunder.dtypes.float16` which uses a python float as the denominator fails with numerical inaccuracy. If the same sample is run with a tensor with empty shape, the test passes. Specifically, if `.item()` is deleted from [this line](https://github.com/Lightning-AI/lightning-thunder/blob/880419df25024b52fe8674fd2ef305348a056a62/thunder/tests/opinfos.py#L74), the test passes.
cc @tfogal
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 with thunder/tests/opinfos.py at line 74 and run test_core_vs_torch_consistency_div_nvfuser_cuda_thunder.dtypes.float16. Compare the failing float16 division with a Python-float denominator against the empty-shape case, then trace the relevant nvfuser consistency path. Done means the sample no longer reports numerical inaccuracy while retaining the existing test coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100