-
Notifications
You must be signed in to change notification settings - Fork 159
bugs fix prebuild=1/2 #1516
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: main
Are you sure you want to change the base?
bugs fix prebuild=1/2 #1516
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 fixes bugs related to the PREBUILD_KERNELS functionality in the setup process. The changes refactor the kernel exclusion logic, add environment variable support for specifying the AITER metadata directory, and extend prebuild support from just PREBUILD_KERNELS=1 to all non-zero values.
Key Changes:
- Refactored
exclude_opslogic into a cleanerget_exclude_ops()function - Extended prebuild kernel support to work with
PREBUILD_KERNELSvalues 1, 2, and 3 (not just 1) - Added
AITER_META_DIRenvironment variable support with validation fallback
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| setup.py | Refactors prebuild kernel exclusion logic, sets AITER_META_DIR environment variable, extends prebuild support to all non-zero PREBUILD_KERNELS values, and adds preprocessor flags to build configuration |
| aiter/jit/core.py | Adds environment variable override mechanism for AITER_META_DIR with validation fallback to ensure the directory contains required csrc subdirectory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| "module_mha_varlen_bwd", | ||
| ] | ||
| elif PREBUILD_KERNELS == 3: | ||
| return [] |
Copilot
AI
Dec 1, 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 get_exclude_ops() function does not return a value when PREBUILD_KERNELS is not 1, 2, or 3. This will cause exclude_ops to be None on line 104, leading to a potential error when passed to core.get_args_of_build().
Add a default return statement:
def get_exclude_ops():
if PREBUILD_KERNELS == 1:
return [...]
elif PREBUILD_KERNELS == 2:
return [...]
elif PREBUILD_KERNELS == 3:
return []
else:
return []| return [] | |
| return [] | |
| else: | |
| return [] |
setup.py
Outdated
| flags_cc = list(one_opt_args["flags_extra_cc"]) + ( | ||
| [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] | ||
| if PREBUILD_KERNELS != 0 | ||
| else [] | ||
| ) | ||
| flags_hip = list(one_opt_args["flags_extra_hip"]) + ( | ||
| [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] | ||
| if PREBUILD_KERNELS != 0 | ||
| else [] | ||
| ) |
Copilot
AI
Dec 1, 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 condition if PREBUILD_KERNELS != 0 is redundant inside the build_one_module() function. This function is only called when PREBUILD_KERNELS != 0 (line 106), so the conditional expressions on lines 117-119 and 122-124 will always append the flag.
Simplify to:
flags_cc = list(one_opt_args["flags_extra_cc"]) + [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"]
flags_hip = list(one_opt_args["flags_extra_hip"]) + [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"]| flags_cc = list(one_opt_args["flags_extra_cc"]) + ( | |
| [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] | |
| if PREBUILD_KERNELS != 0 | |
| else [] | |
| ) | |
| flags_hip = list(one_opt_args["flags_extra_hip"]) + ( | |
| [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] | |
| if PREBUILD_KERNELS != 0 | |
| else [] | |
| ) | |
| flags_cc = list(one_opt_args["flags_extra_cc"]) + [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] | |
| flags_hip = list(one_opt_args["flags_extra_hip"]) + [f"-DPREBUILD_KERNELS={PREBUILD_KERNELS}"] |
641410a to
4138884
Compare
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist