Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/149164
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit 7bc2c88 with merge base 71795f1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| // access constants such as M_SQRT2 and M_2_SQRTPI. | ||
| #ifdef _WIN32 | ||
| #define _USE_MATH_DEFINES | ||
| #include <math.h> |
There was a problem hiding this comment.
why not include this header unconditionally?
also can we use instead?
There was a problem hiding this comment.
I mainly wanted to limit the scope of the changes to Windows only builds. But I can see the case for making it unconditional, will update.
also can we use instead?
Sorry, I don't understand this comment 😅
There was a problem hiding this comment.
I meant "can we use <cmath> instead"? I guess GitHub thought it was an HTML tag or something
|
Error message snippet: Will just hide the include in the |
Summary: ## Context This PR is mostly to enable ExecuTorch build for Windows: pytorch/executorch#9198 In ExecuTorch, the optimized GeLU kernel calls the ATen implementation. However, on Windows `math.h` needs to be included with `#define _USE_MATH_DEFINES` in order for math constants to be defined. Test Plan: Rely on CI to make sure existing tests do not break. Tested separately with ExecuTorch to make sure Windows build is successful.
|
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -f "The bot is complaining about BC Lint, but the job keeps getting cancelled immediately. I don't think the signal is accurate. All other jobs are green." |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: ## Context See #149164 for more context. Originally, this fix worked but more recently including `cmath` by itself no longer provides access to math constants on Windows platforms. I found that including `math.h` resolves this. I'm not sure exactly what changed, but this PR updates the header to just use both includes fix the symbols not being found. It might be a bug with a recent Windows update perhaps? Test Plan: CI
Summary: ## Context See #149164 for more context. Originally, this fix worked but more recently including `cmath` by itself no longer provides access to math constants on Windows platforms. I found that including `math.h` resolves this. I'm not sure exactly what changed, but this PR updates the header to just use both includes fix the symbols not being found. It might be a bug with a recent Windows update perhaps? Test Plan: CI Pull Request resolved: #153742 Approved by: https://github.com/swolchok, https://github.com/Skylion007
Summary:
Context
This PR is mostly to enable ExecuTorch build for Windows: pytorch/executorch#9198
In ExecuTorch, the optimized GeLU kernel calls the ATen implementation. However, on Windows
math.hneeds to be included with#define _USE_MATH_DEFINESin order for math constants to be defined.Test Plan:
Rely on CI to make sure existing tests do not break. Tested separately with ExecuTorch to make sure Windows build is successful.
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10