Skip to content

fixing MSVC build#1728

Merged
jjsjann123 merged 3 commits intodevelfrom
lambda_msvc_patch
May 25, 2022
Merged

fixing MSVC build#1728
jjsjann123 merged 3 commits intodevelfrom
lambda_msvc_patch

Conversation

@jjsjann123
Copy link
Copy Markdown
Collaborator

cherry-picked from pytorch#77471

Copy link
Copy Markdown
Collaborator

@naoyam naoyam left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. No idea why this didn't work with MSVC, but 🤷

@jjsjann123
Copy link
Copy Markdown
Collaborator Author

Thanks for the fix. No idea why this didn't work with MSVC, but shrug

Since you asked:

runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp(1230): error C3493: 'channels_last' cannot be implicitly captured because no default capture mode has been specified

https://github.com/pytorch/pytorch/runs/6475265281?check_suite_focus=true

@naoyam
Copy link
Copy Markdown
Collaborator

naoyam commented May 25, 2022

Thanks for the fix. No idea why this didn't work with MSVC, but shrug

Since you asked:

runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp(1230): error C3493: 'channels_last' cannot be implicitly captured because no default capture mode has been specified

https://github.com/pytorch/pytorch/runs/6475265281?check_suite_focus=true

But, I thought that should be automatically captured:

A lambda expression can read the value of a variable without capturing it if the variable
 has const non-volatile integral or enumeration type and has been initialized with a constant expression

https://en.cppreference.com/w/cpp/language/lambda

@jjsjann123
Copy link
Copy Markdown
Collaborator Author

Thanks for the fix. No idea why this didn't work with MSVC, but shrug

Since you asked:

runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\codegen\cuda\test\test_gpu_fused_reduction.cpp(1230): error C3493: 'channels_last' cannot be implicitly captured because no default capture mode has been specified

https://github.com/pytorch/pytorch/runs/6475265281?check_suite_focus=true

But, I thought that should be automatically captured:

A lambda expression can read the value of a variable without capturing it if the variable
 has const non-volatile integral or enumeration type and has been initialized with a constant expression

https://en.cppreference.com/w/cpp/language/lambda

You are perfectly right about this and it should also explain why it never fails for our gcc/clang build. But we should never hold MSVC to be on the same standard 😜
https://developercommunity.visualstudio.com/t/lambda-fails-to-implicitly-capture-constexpr-value/610504

I'll add a link to that bug in the comment

@jjsjann123
Copy link
Copy Markdown
Collaborator Author

Have to give them the credit that it's fixed.. Guess upstream is not on the updated MSVC toolkit.

@jjsjann123 jjsjann123 merged commit fbbbe0a into devel May 25, 2022
@jjsjann123 jjsjann123 deleted the lambda_msvc_patch branch May 25, 2022 22:17
jjsjann123 added a commit that referenced this pull request Jun 22, 2022
Syncing nvfuser devel branch to upstream master. https://github.com/csarofeen/pytorch/

Bug fixes and minor refactor

Squashed commits to WAR github API
Commits that's actually in this PR from the devel branch:

```
4c60e7d Add examples infrastructure for using nvFuser in a standalone program (#1725)
02a05d9 Fix issue #1751 (#1753)
8a69aa3 Refactor NvFuser transpose API to match eager mode behavior (#1746)
ffdf6b7 Remove BroadcastWithoutStride. (#1738)
02bab16 Fix flipping of a boolean flag (#1745)
465d668 cleanup (#1744)
26d354e fixing noncontig broadcast (#1742)
856b6b2 Add IterDomainBuilder (#1736)
1fd974f fixing warning for gcc7 (#1732)
de2740a disabling complex in python tests for #1730 (#1733)
fbbbe0a fixing MSVC build (#1728)
b5feee5 Fix the fused reduction runtime kernel (#1729)
5247682 Re-entrant GroupedGridReduction (#1727)
```

RUN_TORCHBENCH: nvfuser
Pull Request resolved: pytorch#79147
Approved by: https://github.com/davidberard98
jjsjann123 added a commit that referenced this pull request Jun 22, 2022
…h#79406)

Landing reverted PR pytorch#79147.

Syncing nvfuser devel branch to upstream master. https://github.com/csarofeen/pytorch/

Bug fixes and minor refactor

Squashed commits to WAR github API
Commits that's actually in this PR from the devel branch:

```
4c60e7d Add examples infrastructure for using nvFuser in a standalone program (#1725)
02a05d9 Fix issue #1751 (#1753)
8a69aa3 Refactor NvFuser transpose API to match eager mode behavior (#1746)
ffdf6b7 Remove BroadcastWithoutStride. (#1738)
02bab16 Fix flipping of a boolean flag (#1745)
465d668 cleanup (#1744)
26d354e fixing noncontig broadcast (#1742)
856b6b2 Add IterDomainBuilder (#1736)
1fd974f fixing warning for gcc7 (#1732)
de2740a disabling complex in python tests for #1730 (#1733)
fbbbe0a fixing MSVC build (#1728)
b5feee5 Fix the fused reduction runtime kernel (#1729)
5247682 Re-entrant GroupedGridReduction (#1727)
```

RUN_TORCHBENCH: nvfuser
Pull Request resolved: pytorch#79406
Approved by: https://github.com/davidberard98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants