-
Notifications
You must be signed in to change notification settings - Fork 75
[#5153] Update the build flag metadata when loading SPIRV kernel. #5402
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
Conversation
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.
Pull Request Overview
This PR implements a workaround to update build flag metadata when loading SPIRV kernels, specifically addressing feature requirement #5153. The change enables IGC build flag updates when large GRF mode is used during SPIRV kernel loading when register spill size exceeds 1000.
Key changes:
- Modified C driver to return build flags as an additional return value from load_binary function
- Updated Python compiler to capture and apply updated build flags to kernel metadata when they differ from original flags
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| third_party/intel/backend/driver.c | Modified load_binary return value to include build flags string |
| python/triton/compiler/compiler.py | Added logic to capture and update metadata with new build flags when changed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
third_party/intel/backend/driver.c
Outdated
| return Py_BuildValue("(OOiiis)", kernel_bundle_py, kernel_py, n_regs, | ||
| n_spills, n_max_threads, build_flags().data()); |
Copilot
AI
Oct 29, 2025
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.
The addition of build_flags().data() to the return tuple creates a breaking change in the API. Consider versioning this function or providing a backward-compatible wrapper to avoid breaking existing callers that expect a 5-tuple instead of a 6-tuple.
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 is known breaking. It is a short term solution.
|
@etaf Please help to confirm the change works as expected. |
Thanks. |
2095c0a to
b3419c1
Compare
|
@chengjunlu we have the following file in cache: That looks like: We need to make sure |
This is a speific workaround only works for #5153. The build flag in json is only up to the make SPIRV stage not the load binary phase. |
On second thought, it seems there shouldn't be a problem here. What about #5402 (comment)? |
b3419c1 to
5de64d5
Compare
anmyachev
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.
LGTM!
…build flag is updated when the large GRF mode is used in loading SPIRV kernel when register spill size > 1000. Signed-off-by: etaf <[email protected]> Co-authored-by: Lu,Chengjun <[email protected]>
This is workaround for feature requirement in #5153. The IGC build flag is updated when the large GRF mode is used in loading SPIRV kernel when register spill size > 1000.