Skip to content

Conversation

Xia-Weiwen
Copy link
Collaborator

Reland #3052 which is reverted by 5cbbd73

Revert reason: compiler is complaining about switch...case of bool values.

This PR fixes the issue by converting switch...case to if...else

Copy link

pytorch-bot bot commented Sep 30, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 479111c with merge base 5cbbd73 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the ci-no-td label Sep 30, 2025
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 30, 2025
@Xia-Weiwen Xia-Weiwen added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Sep 30, 2025
@Xia-Weiwen
Copy link
Collaborator Author

Hi @jcaip @jerryzh168 Could you please import this patch to check if the error is gone in your internal checks? Thanks.

@Xia-Weiwen
Copy link
Collaborator Author

Hi @jerryzh168 Thanks for approving. Do you still need to import it?

@jcaip
Copy link
Contributor

jcaip commented Sep 30, 2025

Thanks for fixing this @Xia-Weiwen! This is still failing some tests, I'm seeing:

fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:509:44: error: capturing a structured binding is not yet supported in OpenMP
  509 |     at::native::data_index_init(begin, mc, Mc_parallel, nc, Nc);
      |                                            ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:456:37: note: 'Mc_parallel' declared here
  456 |   auto [parallel_on_M, block_m, Mc, Mc_parallel] = get_m_blocking(M);
      |                                     ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:512:24: error: capturing a structured binding is not yet supported in OpenMP
  512 |       int64_t mc_end = parallel_on_M ? mc + 1 : Mc;
      |                        ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:456:9: note: 'parallel_on_M' declared here
  456 |   auto [parallel_on_M, block_m, Mc, Mc_parallel] = get_m_blocking(M);
      |         ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:512:49: error: capturing a structured binding is not yet supported in OpenMP
  512 |       int64_t mc_end = parallel_on_M ? mc + 1 : Mc;
      |                                                 ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:456:33: note: 'Mc' declared here
  456 |   auto [parallel_on_M, block_m, Mc, Mc_parallel] = get_m_blocking(M);
      |                                 ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:515:32: error: capturing a structured binding is not yet supported in OpenMP
  515 |         int64_t m_size = mci * block_m + block_m > M ? M - mci * block_m : block_m;
      |                                ^
fbcode/pytorch/ao/torchao/csrc/cpu/aten_kernels/float8_linear.cpp:456:24: note: 'block_m' declared here
  456 |   auto [parallel_on_M, block_m, Mc, Mc_parallel] = get_m_blocking(M);
      |                        ^
4 errors generated.

@jerryzh168 Long term I think we need to update our C++ linting to be as strict as whatever upstream dependencies we have, so we can find these issues earlier.

@facebook-github-bot
Copy link
Contributor

@jcaip has imported this pull request. If you are a Meta employee, you can view this in D83564232.

@Xia-Weiwen
Copy link
Collaborator Author

Hi @jcaip Thanks for the feedback. I could not see the errors you saw, even not as warnings. I use the following environment to build Torchao:

  • Ubuntu 22.04.3 LTS
  • GCC 12.3.0
  • Python 3.10
  • CMD: USE_CPU_KERNELS=1 python setup.py develop

I can only see the following warnings:

  • warning: ignoring attributes on template argument '__m512' [-Wignored-attributes]
  • warning: ignoring attributes on template argument '__m256i' [-Wignored-attributes]
  • warning: "Py_LIMITED_API" redefined

And these warnings are not from the files this PR adds.
Can you please share the environment, configuration and command to build Torchao so that I can reproduce these errors and fix them in advance? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants