Skip to content

[Static Runtime] Performance optimization for fork operation#79482

Closed
akshayParashar1995 wants to merge 1 commit intopytorch:masterfrom
akshayParashar1995:export-D37126923
Closed

[Static Runtime] Performance optimization for fork operation#79482
akshayParashar1995 wants to merge 1 commit intopytorch:masterfrom
akshayParashar1995:export-D37126923

Conversation

@akshayParashar1995
Copy link
Copy Markdown
Contributor

Summary:

  • StaticModule was being created at runtime which was adding overhead to the forked operation
  • Move staticModule creation to outside of runtime so that StaticRuntime instance can be created on top of same staticModule that is created once

Differential Revision: D37126923

@facebook-github-bot facebook-github-bot added cla signed oncall: jit Add this issue/PR to JIT oncall triage queue labels Jun 14, 2022
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jun 14, 2022

🔗 Helpful links

❌ 1 New Failures

As of commit 3f568a0 (more details on the Dr. CI page):

Expand to see more
  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / linux-xenial-py3.7-clang7-onnx / test (default, 1, 2, linux.2xlarge) (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2022-06-14T16:28:58.9539423Z AssertionError:
2022-06-14T16:28:58.9533224Z   File "/opt/conda/lib/python3.7/site-packages/torch/onnx/verification.py", line 243, in _compare_ort_pytorch_model
2022-06-14T16:28:58.9534005Z     compare_ort_pytorch_model_with_input(input_args, input_kwargs)
2022-06-14T16:28:58.9534760Z   File "/opt/conda/lib/python3.7/site-packages/torch/onnx/verification.py", line 241, in compare_ort_pytorch_model_with_input
2022-06-14T16:28:58.9535328Z     _compare_ort_pytorch_outputs(ort_outs, pt_outs, rtol, atol)
2022-06-14T16:28:58.9536042Z   File "/opt/conda/lib/python3.7/site-packages/torch/onnx/verification.py", line 121, in _compare_ort_pytorch_outputs
2022-06-14T16:28:58.9536598Z     np.testing.assert_allclose(ort_out, pt_out, rtol=rtol, atol=atol)
2022-06-14T16:28:58.9537355Z   File "/var/lib/jenkins/.local/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 1531, in assert_allclose
2022-06-14T16:28:58.9537899Z     verbose=verbose, header=header, equal_nan=equal_nan)
2022-06-14T16:28:58.9538610Z   File "/var/lib/jenkins/.local/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare
2022-06-14T16:28:58.9539104Z     raise AssertionError(msg)
2022-06-14T16:28:58.9539423Z AssertionError: 
2022-06-14T16:28:58.9539832Z Not equal to tolerance rtol=0.01, atol=1e-07
2022-06-14T16:28:58.9540057Z 
2022-06-14T16:28:58.9540204Z Mismatched elements: 1 / 2000 (0.05%)
2022-06-14T16:28:58.9540549Z Max absolute difference: 6144.
2022-06-14T16:28:58.9540891Z Max relative difference: 0.01771957
2022-06-14T16:28:58.9541457Z  x: array([[ 2.037441e+09, -1.473809e+09, -3.848481e+09, ..., -5.476922e+09,
2022-06-14T16:28:58.9541796Z          1.347222e+09,  4.871129e+09],
2022-06-14T16:28:58.9542243Z        [ 2.015860e+09, -1.553201e+09, -3.911037e+09, ..., -5.523245e+09,
2022-06-14T16:28:58.9542585Z          1.304078e+09,  4.878778e+09]], dtype=float32)
2022-06-14T16:28:58.9543071Z  y: array([[ 2.037441e+09, -1.473809e+09, -3.848482e+09, ..., -5.476924e+09,

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D37126923

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D37126923

…#79482)

Summary:
Pull Request resolved: pytorch#79482

- StaticModule was being created at runtime which was adding overhead to the forked operation
- Move staticModule creation to outside of runtime so that StaticRuntime instance can be created on top of same staticModule that is created once

Reviewed By: tenpercent

Differential Revision: D37126923

fbshipit-source-id: 95473f4d70e50216c823ee02c85c05211811a919
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D37126923

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Copy Markdown
Contributor

Hey @akshayParashar1995.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Jun 14, 2022
Summary:
Pull Request resolved: #79482

- StaticModule was being created at runtime which was adding overhead to the forked operation
- Move staticModule creation to outside of runtime so that StaticRuntime instance can be created on top of same staticModule that is created once

Reviewed By: tenpercent

Differential Revision: D37126923

fbshipit-source-id: 8d6f1e8557ad86a557d2295ff5bf8ad847724033
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 25, 2026
…#79482)

Summary:
- StaticModule was being created at runtime which was adding overhead to the forked operation
- Move staticModule creation to outside of runtime so that StaticRuntime instance can be created on top of same staticModule that is created once

Differential Revision: D37126923

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

Labels

cla signed fb-exported Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants