KEMBAR78
Fix too big to optimize in test, actually use O0 when aot_inductor.compile_wrapper_with_O0 is set by yushangdi · Pull Request #148714 · pytorch/pytorch · GitHub
Skip to content

Conversation

yushangdi
Copy link
Contributor

@yushangdi yushangdi commented Mar 6, 2025

Summary:

  1. Check against the "0" char instead

  2. We got the following error when using anything other than O0 flag: error: Function ZN5torch12aot_inductorL22__check_inputs_outputsEPP16AtenTensorOpaqueS3 is too big to optimize [-Werror,-Wignored-optimization-argument] So we use O0 flag in wrapper code when aot_inductor.compile_wrapper_opt_level is set to O0.

Test Plan:

 buck run  'fbcode//mode/opt' fbcode//deeplearning/aot_inductor/cpu/test:ads_second_stage_dsnn_models_aoti_lowering_test -- -r AdsSecondStageDSNNModelsAOTILoweringTest

Differential Revision: D70670957

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/148714

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b20b51c with merge base 1e37e5b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70670957

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70670957

@yushangdi yushangdi requested a review from desertfire March 6, 2025 23:43
@yushangdi yushangdi added the topic: not user facing topic category label Mar 6, 2025
yushangdi added a commit to yushangdi/pytorch that referenced this pull request Mar 8, 2025
…mpile_wrapper_with_O0 is set (pytorch#148714)

Summary:

1. the '\0' char cannot be properly recognized. Change to use '0' instead.

2. We got the following error when using anything other than O0 flag: `error: Function ZN5torch12aot_inductorL22__check_inputs_outputsEPP16AtenTensorOpaqueS3 is too big to optimize [-Werror,-Wignored-optimization-argument]` So we use O0 flag in wrapper code when `aot_inductor.compile_wrapper_with_O0` is set

Test Plan:
```
 buck run  'fbcode//mode/opt' fbcode//deeplearning/aot_inductor/cpu/test:ads_second_stage_dsnn_models_aoti_lowering_test -- -r AdsSecondStageDSNNModelsAOTILoweringTest
```

Differential Revision: D70670957
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70670957

"""
bool _check_aoti_runtime_check_inputs_env() {
const static char* env_var_value = getenv("AOTI_RUNTIME_CHECK_INPUTS");
const static bool result = env_var_value != nullptr && env_var_value[0] != '\0';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is just escaping the backslash with a double backslash the proper fix?

Copy link
Contributor Author

@yushangdi yushangdi Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skylion007 I intend to check if it's a 0, not checking against the null character. The original code was wrong. I guess the PR summary was misleading, I updated it now.

@desertfire
Copy link
Contributor

The second bullet of your PR description is also stale. Please update.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 10, 2025
…mpile_wrapper_with_O0 is set (pytorch#148714)

Summary:

1. Check against the "0" char instead

2. We got the following error when using anything other than O0 flag: `error: Function ZN5torch12aot_inductorL22__check_inputs_outputsEPP16AtenTensorOpaqueS3 is too big to optimize [-Werror,-Wignored-optimization-argument]` So we use O0 flag in wrapper code when `aot_inductor.compile_wrapper_opt_level` is set to `O0`.

Test Plan:
```
 buck run  'fbcode//mode/opt' fbcode//deeplearning/aot_inductor/cpu/test:ads_second_stage_dsnn_models_aoti_lowering_test -- -r AdsSecondStageDSNNModelsAOTILoweringTest
```

Reviewed By: desertfire

Differential Revision: D70670957
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70670957

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants