Skip to content

RFC-0043 Torch Native Runtime #72

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

zhxchen17
Copy link

No description provided.

@zhxchen17
Copy link
Author

cc @albanD @malfet @seemethere


### “Any performance regression from TorchScript?”

* Single digit percentage (<10%) improvement over TorchScript interpreter from improvements like static dispatch, memory planning, inter-op parallelism and overhead reduction.

Choose a reason for hiding this comment

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

Suggested change
* Single digit percentage (<10%) improvement over TorchScript interpreter from improvements like static dispatch, memory planning, inter-op parallelism and overhead reduction.
No, on the contrary we expect * single digit percentage (<10%) improvement over TorchScript interpreter from improvements like static dispatch, memory planning, inter-op parallelism and overhead reduction.

@zhxchen17 zhxchen17 requested a review from gmagogsfm April 28, 2025 16:17
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request Apr 29, 2025
Summary:
Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
```
buck2 run mode/dev-nosan caffe2/test/cpp/nativert:nativert
```

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request Apr 29, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
```
buck2 run mode/dev-nosan caffe2/test/cpp/nativert:nativert
```

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request Apr 29, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
```
buck2 run mode/dev-nosan caffe2/test/cpp/nativert:nativert
```

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request Apr 29, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
```
buck2 run mode/dev-nosan caffe2/test/cpp/nativert:nativert
```

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request Apr 30, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
```
buck2 run mode/dev-nosan caffe2/test/cpp/nativert:nativert
```

Differential Revision: D73820548
pytorch-bot bot pushed a commit to pytorch/pytorch that referenced this pull request May 1, 2025
Summary:
Pull Request resolved: #152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 1, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 2, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 2, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 2, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 2, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 3, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
pytorch-bot bot pushed a commit to pytorch/pytorch that referenced this pull request May 5, 2025
Summary:
Pull Request resolved: #152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 5, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548
yiming0416 added a commit to yiming0416/pytorch that referenced this pull request May 5, 2025
Summary:
Pull Request resolved: pytorch#152475

Torch Native Runtime RFC: pytorch/rfcs#72

Thi diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core.

Test Plan:
Internal CI.
GitHub CI with newly added test under `test/cpp/nativert/test_tensor_meta.cpp`

Reviewed By: zhxchen17

Differential Revision: D73820548
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request May 6, 2025
Summary:
Torch Native Runtime RFC: pytorch/rfcs#72

This diff moves `TensorMeta.cpp` and `TensorMeta.h` to PyTorch core under `torch/nativert/graph/`

Existing `torch::_export::TensorMeta` in `torch/csrc/utils/generated_serialization_types.h` is auto-generated from the export serde schema and therefore only containing the most basic serializable types. We need the newly added `TensorMeta.cpp` to deserialize the metadata into a in-memory class with c10 types so that it can be consumed by the runtime later.

Test Plan:

Added test under `test/cpp/nativert/test_tensor_meta.cpp`

Differential Revision: D73820548

Pull Request resolved: #152475
Approved by: https://github.com/albanD
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request May 7, 2025
Summary:
Torch Native Runtime RFC: pytorch/rfcs#72
Port string utils functions join and split to c10/util

Test Plan:
Added tests in `string_util_test.cpp`
buck2 run mode/opt caffe2/c10/test:util_base_tests

Differential Revision: D74202473

Pull Request resolved: #152873
Approved by: https://github.com/cyyever, https://github.com/Skylion007
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request May 20, 2025
Summary:
Torch Native Runtime RFC: pytorch/rfcs#72

Added an in-memory representation for input and output specs of a graph. The GraphSignature class models the input and output specs of an exported graph produced by torch.export, which holds the graph information deserialized from the pt2 archive package. Runtime relies on the GraphSignature for weight name lookup and weight loading.

The serialization schema is defined in torch/_export/serde/schema.py
See more at: https://docs.pytorch.org/docs/stable/export.html#torch.export.ExportGraphSignature

Test Plan: Added tests under `test/cpp/nativert/test_graph_signature.cpp`

Differential Revision: D73895378

Pull Request resolved: #152969
Approved by: https://github.com/swolchok
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

ghstack-source-id: 286574727
Pull Request resolved: #154532
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
… nativert"

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 28, 2025
Pull Request resolved: #154532

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.
ghstack-source-id: 286711904
@exported-using-ghexport

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
Pull Request resolved: #154532

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.
ghstack-source-id: 286813445
@exported-using-ghexport

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
… nativert"

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 29, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
Pull Request resolved: #154532

#buildall

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.
ghstack-source-id: 287076545
@exported-using-ghexport

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
We split the large PR for adding Graph.h and Graph.cpp to `nativert` into 3 smaller PRs:
1. **Add header file**
2. Add source file
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75491860](https://our.internmc.facebook.com/intern/diff/D75491860/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
… nativert"

We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. Add source file
3. **Add test and build rules**

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75495273](https://our.internmc.facebook.com/intern/diff/D75495273/)

[ghstack-poisoned]
yiming0416 added a commit to pytorch/pytorch that referenced this pull request May 30, 2025
We split the large PR for adding Graph.h and Graph.cpp to nativert into 3 smaller PRs:

1. Add header file
2. **Add source file**
3. Add test and build rules.

Torch Native Runtime RFC: pytorch/rfcs#72

4 classes have been introduced: `Graph`, `Node`, `Value`, `Type`
- `Type` represents the kind of a `Value`
- `Value` represents a single symbolic value, it could be any kind that exists in `Type`. Values are inputs and outputs of a `Node`.
- `Node` represents a single unit of execution, typically a PyTorch op.
- `Graph` represents a model's computation graph, which is designed to facilitate transformation/analysis.

Differential Revision: [D75492405](https://our.internmc.facebook.com/intern/diff/D75492405/)

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants