Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cpp_wrapper: Precompile device-specific header files #144002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Dec 30, 2024

🔗 Helpful Links

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

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

⏳ No Failures, 5 Pending

As of commit 7c342c1 with merge base 93d98ac (image):
💚 Looks good so far! There are no failures yet. 💚

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

benjaminglass1 added a commit that referenced this pull request Dec 30, 2024
This saves us about a second per compilation, which is _massive_ for the OpInfo tests. Total OpInfo test runtime is down about 2x.

ghstack-source-id: 14933f8
Pull Request resolved: #144002
@benjaminglass1 benjaminglass1 added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 31, 2024
[ghstack-poisoned]
@benjaminglass1 benjaminglass1 self-assigned this Jan 2, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@benjaminglass1 benjaminglass1 marked this pull request as ready for review January 3, 2025 18:08
@benjaminglass1 benjaminglass1 removed the ciflow/trunk Trigger trunk jobs on your pull request label Jan 3, 2025
[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Jan 3, 2025
This saves us about a second per compilation, which is _massive_ for the OpInfo tests. Total OpInfo test runtime is down about 2x.

ghstack-source-id: 5aef659
Pull Request resolved: #144002
@benjaminglass1
Copy link
Collaborator Author

@desertfire I've stacked the remainder of the test bugfix stack underneath this, temporarily, in order to test whether the speedups here allow us to run the full suite of inductor tests. Hopefully we'll just be able to merge those out from underneath this, but if not I'll unstack whenever you need.

[ghstack-poisoned]
@desertfire
Copy link
Contributor

@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

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

@desertfire desertfire left a comment

Choose a reason for hiding this comment

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

Chatted offline and test will come in a follow-up PR.

@benjaminglass1
Copy link
Collaborator Author

@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

@huydhn
Copy link
Contributor

huydhn commented Feb 11, 2025

@pytorchbot revert -m 'Sorry for reverting your change but this breaks some inductor tests running internally' -c ghfirst

======================================================================
ERROR: test_cpp_wrapper (caffe2.test.inductor.test_cudagraph_trees.CudaGraphTreeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/fbcode/platform010/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/caffe2/test/inductor/test_cudagraph_trees.py", line 2503, in test_cpp_wrapper
    compiled_result = self.run_twc(compiled, example_input)
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/caffe2/test/inductor/test_cudagraph_trees.py", line 197, in run_twc
    fn(*args, **kwargs)
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_dynamo/eval_frame.py", line 574, in _fn
    raise e.remove_dynamo_frames() from None  # see TORCHDYNAMO_VERBOSE=1
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/compile_fx.py", line 752, in _compile_fx_inner
    raise InductorError(e, currentframe()).with_traceback(
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/compile_fx.py", line 737, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/compile_fx.py", line 1402, in fx_codegen_and_compile
    return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/compile_fx.py", line 1122, in codegen_and_compile
    compiled_fn = graph.compile_to_module().call
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/graph.py", line 1986, in compile_to_module
    return self._compile_to_module()
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/graph.py", line 2028, in _compile_to_module
    mod = PyCodeCache.load_by_key_path(
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/codecache.py", line 2853, in load_by_key_path
    mod = _reload_python_module(key, path)
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/runtime/compile_tasks.py", line 51, in _reload_python_module
    exec(code, mod.__dict__, mod.__dict__)
  File "/re_tmp/tmpwrjbuu4z/jq/cjq53uwok6fj5qand5kfwnazczljuwix4xupx7gmoxjlon2f4hea.py", line 197, in <module>
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/codecache.py", line 2347, in load_pybinding
    return cls.load_pybinding_async(*args, **kwargs)()
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/codecache.py", line 2328, in load_pybinding_async
    get_result = cls.load_async(
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/codecache.py", line 2096, in load_async
    _precompile_header(
  File "/re_cwd/buck-out/v2/gen/fbcode/bbdd369aded5cb42/caffe2/test/inductor/__cudagraph_trees__/cudagraph_trees#link-tree/torch/_inductor/codecache.py", line 1974, in _precompile_header
    extra=f"{hashable_cmd_line} {compiler_version} {torch.version.__version__} {torch.version.build_uuid}",
torch._inductor.exc.InductorError: AttributeError: module 'torch.version' has no attribute 'build_uuid'

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information


----------------------------------------------------------------------
Ran 1 test in 4.217s

FAILED (errors=1)

I think @desertfire has been looking into the failure

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@benjaminglass1 your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Feb 11, 2025
This reverts commit de6efa1.

Reverted #144002 on behalf of https://github.com/huydhn due to Sorry for reverting your change but this breaks some inductor tests running internally ([comment](#144002 (comment)))
@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 11, 2025
@benjaminglass1
Copy link
Collaborator Author

@desertfire @huydhn I'll open a new PR to re-land this in, to avoid any issues with the associated internal revision.

desai0007 pushed a commit to desai0007/test-repo-pytorch that referenced this pull request Feb 26, 2025
This saves us about a second per compilation, which is _massive_ for the OpInfo tests. Total OpInfo test runtime is down about 2x.

ghstack-source-id: 84d4ba3
Pull Request resolved: pytorch/pytorch#144002
@github-actions github-actions bot deleted the gh/benjaminglass1/47/head branch March 14, 2025 02:08
pytorchmergebot pushed a commit that referenced this pull request Mar 17, 2025
This saves us about a second per compilation, which is _massive_ for the OpInfo tests.  Total OpInfo test runtime is down about 2x from this change alone.

Relands #144002, with changes needed by fbcode internals.

Pull Request resolved: #146928
Approved by: https://github.com/desertfire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants