-
Notifications
You must be signed in to change notification settings - Fork 566
feat: add support for custom compile options in torch_xla.compile and… #9575
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
feat: add support for custom compile options in torch_xla.compile and… #9575
Conversation
b3e8b3e
to
2a4b284
Compare
@qihqi Thank you for your review! I realized there was a lint issue and have fixed it. Would you mind re-running the tests? |
hi @sshonTT would you rebase to latest HEAD? the 2 CI issue should be fixed |
Head branch was pushed to by a user without write access
2a4b284
to
2a2eed5
Compare
hi @qihqi , gentle reminder. |
Hi @zhanyong-wan — not sure if this is the right tag. I’m waiting on @qihqi’s follow-up (he previously approved). I rebased per his suggestion and want to confirm CI is green. Could you trigger CI for this PR and, if you have time, give it a review? Thanks! |
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.
Thanks!
2bdd9ed
to
7be5b39
Compare
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.
Thanks!
7be5b39
to
4278f97
Compare
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.
In the future, could you avoid git rebase or git merge during a code review? Otherwise it's hard to track the changes. Thanks!
4278f97
to
f3ad8bd
Compare
Head branch was pushed to by a user without write access
f3ad8bd
to
a27f105
Compare
Head branch was pushed to by a user without write access
a27f105
to
63bb881
Compare
… PJRT backend This change introduces the ability to pass custom compile options from Python down to the PJRT backend, allowing users to fine-tune XLA compilation behavior without modifying core code. Key changes: * Python API * Added custom_compile_options parameter to torch_xla.compile for passing compile-time options as a dict (supports bool, float, int, and str values). * Added torch_xla.set_custom_compile_options() utility for setting compile options globally. * Added internal binding _XLAC._set_custom_compile_options(). * C++ Runtime * Added SetCustomCompileOptions() virtual method to ComputationClient and implemented it in PjRtComputationClient. * PjRtComputationClient now stores custom_compile_options_ and injects them into xla::CompileOptions.env_option_overrides during compilation. * Options are stringified before being passed to XLA for compatibility. Motivation: This enables advanced users to pass through backend-specific tuning flags (e.g., enabling experimental optimizations, toggling partitioning strategies) without hardcoding them, improving flexibility for research and debugging workflows.
63bb881
to
9799ed0
Compare
I just noticed that |
@zhanyong-wan , @qihqi Could you re-trigger this test? I had checked on my local, and want to see if it is working. |
Thanks for running CI! Can this be merged in? |
Yes, please resolve the comments and merge. |
… PJRT backend
Issue description : #9555
This change introduces the ability to pass custom compile options from Python down to the PJRT backend, allowing users to fine-tune XLA compilation behavior without modifying core code. Key changes: