-
Notifications
You must be signed in to change notification settings - Fork 6
Imarkov/conditional compilation ranges #127
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
base: imarkov/fused_allreduce_torch_native
Are you sure you want to change the base?
Imarkov/conditional compilation ranges #127
Conversation
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
…itional_compilation_ranges Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
…itional_compilation_ranges Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
…itional_compilation_ranges
ProExpertProg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial thoughts. Could we also use a dataclass instead of a tuple for a compiled range? We can add utility methods (like is_single_size), names to the elements, and docs to make the code clearer.
Also, currently if there is more than one range above the cudagraphs capture size, I think we don't ever trigger it in the GPU model runner as the compilation only happens as the compiled model is invoked with the shape (with _dummy_run) - we should make sure to dummy run for each compile range.
I also think we should try to give hints to Inductor about the range, can be done as a follow-up.
| elapsed = now - compilation_start_time | ||
| compilation_config.compilation_time += elapsed | ||
| if runtime_shape is None: | ||
| if compile_range is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost the compilation time update
| if compile_range is None: | |
| compilation_config.compilation_time += elapsed | |
| if compile_range is None: |
| """Sizes to compile for inductor. In addition | ||
| to integers, it also supports "cudagraph_capture_sizes" to | ||
| specify the sizes for cudagraph capture.""" | ||
| compile_ranges_split_points: list[int] | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment implies ranges are done inclusive-exclusive but in the code you use inclusive-inclusive. Can we standardize on inclusive-exclusive?
| state = { | ||
| "ranges": self.ranges, | ||
| } | ||
| return InductorPass.hash_dict(state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the current range to cache key and check the number of times the manager gets called (to make sure the bug you found doesn't manifest)
Purpose
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.