Purge MINIFIER_SPAWNED#90089
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/90089
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit 6bd7b90: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| ) | ||
| ) | ||
| return True | ||
| raise |
There was a problem hiding this comment.
We need this as it moved to runtime
There was a problem hiding this comment.
OK, well, if you want to change the behavior here, you need to at least update the warning above.
But the original intent of squelching the error still seems valid; if you get stuck on an unrelated exception, you're never going to get to the actual failure that you wanted to minify. So I don't really understand your stated justification...
Purge MINIFIER_SPAWNED cc mlazos soumith yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire [ghstack-poisoned]
Purge MINIFIER_SPAWNED cc mlazos soumith yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire [ghstack-poisoned]
torch/_dynamo/debug_utils.py
Outdated
| return gm | ||
| def backend_accuracy_eval_fwd(*args): | ||
| # Set the eval mode to remove randomness. | ||
| gm.eval() |
There was a problem hiding this comment.
This looks like an unnecessary behavior change; previously gm was changed to eval() mode at compile time, now it is reset to eval time every runtime.
...arguably we shouldn't be changing the model to eval mode at all, doesn't this mean running with accuracy minifier changes the results of your model...
There was a problem hiding this comment.
Good point, let's go back to the prior way where we ensure we compile.
torch/_dynamo/debug_utils.py
Outdated
| return not same_two_models(gm, compiled_gm, args) | ||
|
|
||
| # (4) Check Accuracy | ||
| if not same_two_models(gm, compiled_gm, args): |
torch/_dynamo/debug_utils.py
Outdated
| minifier( | ||
| gm, | ||
| example_inputs, | ||
| module_fails=module_fails_accuracy, |
There was a problem hiding this comment.
This looks questionable. The original fails_fn recompiles the passed in gm. However, your fails_fn here simply reuses the original compiled_gm as is. This seems wrong: I'd expect the minifier to be modifying the gm passed in and expecting it to recompile. Without recompiling it I find it hard to see how the minifier could do the correct thing here.
There was a problem hiding this comment.
Good point, I bet it minifies but not the same way, as the backend is taken out. Let me revisit this.
Purge MINIFIER_SPAWNED cc mlazos soumith yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire [ghstack-poisoned]
Purge MINIFIER_SPAWNED cc mlazos soumith yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire [ghstack-poisoned]
|
|
||
| return not same_two_models(gm, compiled_gm, example_inputs, only_fwd) | ||
| if real_args is None: | ||
| real_args = example_inputs |
There was a problem hiding this comment.
Is example inputs expected to be non-fake if real args is None?
| return gm | ||
| # (4) Bind the current compiler_fn and real_args to accuracy_eval | ||
| # We need to do this in order to ensure that (a) we correctly recompile on every | ||
| # minification, and (b) that the args captured here, in the runtime, are passed to eval |
There was a problem hiding this comment.
This comment is backwards. To "correctly recompile on every minification", the bug in https://github.com/pytorch/pytorch/pull/90089/files/ae9f856428538468b5da8825e9d796790b010db6#r1038871303 was that you didn't pass backend_accuracy_fails to the minifier at all. Binding compiler_fn/real_args has nothing to do with ensuring that we actually recompile; you must bind them for the simpler reason that the minifier isn't going to pass those arguments directly lol
There was a problem hiding this comment.
Also, it would be good to understand why the minifier tests did not capture this case; maybe there is a simple test that can be added for this bug.
There was a problem hiding this comment.
This comment is backwards. To "correctly recompile on every minification", the bug in https://github.com/pytorch/pytorch/pull/90089/files/ae9f856428538468b5da8825e9d796790b010db6#r1038871303 was that you didn't pass
backend_accuracy_failsto the minifier at all. Binding compiler_fn/real_args has nothing to do with ensuring that we actually recompile; you must bind them for the simpler reason that the minifier isn't going to pass those arguments directly lol
I was passing a different function, identical to this except for recompilation. So now I'm confused by what you mean.
There was a problem hiding this comment.
The comment says "Bind the current compiler_fn and real_args to accuracy_eval; we need to do this". I parse this as "we need to [Bind the current compiler_fn and real_args]". Let's suppose I removed this binding. Then I would expect this code to fail with "not enough parameters passed".
ezyang
left a comment
There was a problem hiding this comment.
I'm still very skeptical about the change in same_two_models. There are also comments I'd like to see addressed.
|
@anijain2305 ping |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
Purge MINIFIER_SPAWNED
cc @mlazos @soumith @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire