Lightning-AI / Lightning-AI/lightning-thunder
[symbolic values] Trace bakes in the initial value of input used for trace construction
Open
@kshitij12345 is already working on this.
Since Dec 11, 2025.
symbolic values
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
Repro:
import thunder
import torch
import math
def fn(x, y):
return x + y
tfn = thunder.jit(fn, cache="symbolic values")
tfn(1, 2)
print(thunder.last_traces(tfn)[-1])
# def computation(x, y):
# # x: "int 1"
# # y: "int 2"
# # /opt/pytorch/lightning-thunder/test.py:6: return x + y
# i3 = operator.add(x, y) # i3: "int 3"
# # i3 = prims.add(x, y) # i3: "int 3"
# return (i3,)
tfn(1, 3)
print(thunder.last_traces(tfn)[-1])
# def computation(x, y):
# # x: "int 1"
# # y: "int 2"
# # /opt/pytorch/lightning-thunder/test.py:6: return x + y
# i3 = operator.add(x, y) # i3: "int 3"
# # i3 = prims.add(x, y) # i3: "int 3"
# return (i3,)
Trace bakes in the initial values for # x: "int 1", # y: "int 2" which is confusing. It would be better to just print x: int.
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.
Assessment
This issue has not been assessed yet.