Skip to content

Install fmtlib headers.#164139

Closed
ysiraichi wants to merge 1 commit intomainfrom
ysiraichi/install-fmtlib-headers-v12
Closed

Install fmtlib headers.#164139
ysiraichi wants to merge 1 commit intomainfrom
ysiraichi/install-fmtlib-headers-v12

Conversation

@ysiraichi
Copy link
Collaborator

@ysiraichi ysiraichi commented Sep 29, 2025

fmtlib version was updated to 12.0.0 in #163441.

In this new version, due to fmtlib/fmt#4536, PyTorch started not installing fmtlib headers anymore. Because of that, PyTorch/XLA build CI started to fail pytorch/xla#9653. While we did fix it internally pytorch/xla#9650, I believe that PyTorch should continue installing the fmtlib headers, since it is a dependency of its C API python_arg_parser.h.

PyTorch/XLA CI was moved to unstable.yml in #159272, and later removed in #163564. This PyTorch/XLA build failure went under the radar, since the fmtlib update only landed on September 22.

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 29, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7cef2e0 with merge base 90512fa (image):
💚 Looks good so far! There are no failures yet. 💚

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

@cyyever
Copy link
Collaborator

cyyever commented Sep 29, 2025

I don't think we want to install libfmt, otherwise we could have used it in more headers. libfmt have never been installed. Is it better to remove usage of it from python_arg_parser.h?

@ysiraichi
Copy link
Collaborator Author

If I understand it correctly, it was installed by default before fmtlib/fmt#4536, since we didn't explicitly set FMT_INSTALL=OFF. I confirmed the presence of torch/include/fmt directory after compilation (before the version bump).

@ysiraichi
Copy link
Collaborator Author

ysiraichi commented Sep 29, 2025

Is it better to remove usage of it from python_arg_parser.h?

I don't think that solves the issue.
There are a lot of files under torch/csrc that do include fmt/format.h.

@Skylion007
Copy link
Collaborator

Yeah it should be installed and installing it was the default it. Note: @cyyever in this case installing it just means including it in then headers included with the PyTorch wheel.

@Skylion007
Copy link
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 29, 2025
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

This is probably fine, though I wonder if we really want to ship fmtlib headers with torch wheel

@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

@Skylion007
Copy link
Collaborator

This is probably fine, though I wonder if we really want to ship fmtlib headers with torch wheel

We do if want users to be able to build torch cpp_extensions etc. Don't we already ship a ton of other headers from third_party packages already in the include path? It's either that or ban libfmt from all header files in PyTorch.

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@Skylion007
Copy link
Collaborator

@pytorchbot merge

@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

@cyyever
Copy link
Collaborator

cyyever commented Sep 30, 2025

@pytorchbot merge -f "ROCM pending"

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@github-actions github-actions bot deleted the ysiraichi/install-fmtlib-headers-v12 branch October 31, 2025 02:16
ysiraichi added a commit to pytorch/xla that referenced this pull request Nov 6, 2025
This PR removes the temporary fmtlib dependency introduced in #9650 (see
issue #9653).

As explained [in this comment][1], the dependency was only added to work
around a build issue that should have been fixed upstream in PyTorch.
Before the `fmtlib` version bump to 12 in PyTorch
(pytorch/pytorch#163441), `fmtlib` headers were exported by default.
After the bump, they stopped being exported, which caused the issue.

That behavior has since been fixed in PyTorch (pytorch/pytorch#164139),
so we can safely remove the explicit fmtlib dependency.

[1]:
#9650 (review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants