-
Notifications
You must be signed in to change notification settings
8000
- Fork 24.1k
Question regarding computing ValueRanges for symbolic nodes #128640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently we do not support symbolic value ranges, although that would be great to add. cc @lezcano |
As it stands, it'd be quite a big effort (or straight up impossible) to extend value ranges to return symbols. There are too many if-elses reflecting how the functions act on different values (whether they are increasing, decreasing etc) |
@lezcano, maybe it'd be easier within constraints. e.g. here, the inputs are both size like, >= 2. and within limited set of operators. but yea, it's tricky |
Thanks for your comments @eellison @lezcano. Curently |
What do you mean by "can we use this"? @eellison nah, as soon as you have a minus you have the same issues. In general it's just a very difficult problem without using external algebraic solvers. |
Sorry if I was unclear. |
for that, yes, that shoñuld give you an upper bound on the value ranges of any expression. Elias thought you were asking to get bounds on an expression in terms of its symbolic values, which we don't support. In general, to ask questions, we ask people to use the forums https://discuss.pytorch.org/ Closing as not an issue. |
🐛 Describe the bug
Hello,
For some models, we have observed
SymInt
nodes in the graph which are of the forms0*s1
.s0
ands1
are otherSymInt
Nodes in the graph.Here's the shape_env info about
s0*s1
node,I would like to get the
ValueRanges
fors0*s1
directly. This is currently working for usWe use
var_to_val
as the optimal (or general) value that the variable has and var_range to be the (min, max) values it can take.So is
shape_env.bound_sympy
andexpr.xreplace(shape_env.var_to_val)
correct way to computeValueRanges
for suchSymInt
nodes such ass0*s1
? Are there any other recommendations ? Thankscc: @ezyang @avikchaudhuri @angelayi
Versions
[pip3] numpy==1.26.4
[pip3] pytorch-triton==3.0.0+45fff310c8
[pip3] torch==2.4.0.dev20240610+cu121
[pip3] torch-tensorrt==2.4.0.dev0+a8a079715
[pip3] torchvision==0.19.0.dev20240610+cu121
[pip3] triton==2.3.1
transformers==4.41.2
cc @ezyang @anijain2305 @chauhang
The text was updated successfully, but these errors were encountered: