-
Notifications
You must be signed in to change notification settings - Fork 177
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
PyTorch custom operators for graph operations #9094
Merged
smuzaffar
merged 6 commits into
cms-sw:IB/CMSSW_14_1_X/master
from
valsdav:pytorch-custom-ops-14_1_x
Mar 27, 2024
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aca5c02
testig pytorch_scatter integration
valsdav c20e4f9
Added pytorch custom ops tools
valsdav 71e66f5
Added pytorch custom ops tool
valsdav d5b9fc2
using the original github repositories, no patches needed
valsdav 5e6e82d
Added spec file for pytorch-custom-ops
valsdav 492ec08
fixed env variables for new tools
valsdav File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### RPM external pytorch-cluster 1.6.3 | ||
## INCLUDE compilation_flags | ||
## INCLUDE cpp-standard | ||
%define tag f2d99195a0003ca2d2ba9ed50d0117e2f23360e0 | ||
%define branch master | ||
%define github_user rusty1s | ||
|
||
Source: git+https://github.com/%{github_user}/pytorch_cluster.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz | ||
|
||
BuildRequires: cmake | ||
Requires: pytorch cudnn | ||
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} | ||
|
||
%prep | ||
%setup -n %{n}-%{realversion} | ||
# Make sure the default c++sdt stand is c++14 | ||
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt | ||
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt | ||
|
||
%build | ||
|
||
rm -rf ../build && mkdir ../build && cd ../build | ||
|
||
|
||
cmake ../%{n}-%{realversion} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=%{i} \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \ | ||
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
-DCMAKE_CXX_FLAGS="%{build_flags}" \ | ||
-DBUILD_TEST=OFF \ | ||
-DWITH_PYTHON=OFF \ | ||
-DWITH_CUDA=OFF \ | ||
-DBUILD_TEST=OFF \ | ||
-DBUILD_SHARED_LIBS=ON | ||
|
||
|
||
make %{makeprocesses} VERBOSE=1 | ||
|
||
%install | ||
cd ../build | ||
make %{makeprocesses} install VERBOSE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### RPM external pytorch-custom-ops 1.0 | ||
Source: none | ||
Requires: pytorch-scatter | ||
Requires: pytorch-cluster | ||
Requires: pytorch-sparse | ||
%prep | ||
%build | ||
%install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### RPM external pytorch-scatter 2.1.2 | ||
## INCLUDE compilation_flags | ||
## INCLUDE cpp-standard | ||
%define tag c095c62e4334fcd05e4ac3c4bb09d285960d6be6 | ||
%define branch master | ||
%define github_user rusty1s | ||
|
||
Source: git+https://github.com/%{github_user}/pytorch_scatter.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz | ||
|
||
BuildRequires: cmake | ||
Requires: pytorch cudnn | ||
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} | ||
|
||
%prep | ||
%setup -n %{n}-%{realversion} | ||
# Make sure the default c++sdt stand is c++14 | ||
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt | ||
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt | ||
|
||
%build | ||
|
||
rm -rf ../build && mkdir ../build && cd ../build | ||
|
||
|
||
cmake ../%{n}-%{realversion} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=%{i} \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \ | ||
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
-DCMAKE_CXX_FLAGS="%{build_flags}" \ | ||
-DBUILD_TEST=OFF \ | ||
-DWITH_PYTHON=OFF \ | ||
-DWITH_CUDA=OFF \ | ||
-DBUILD_TEST=OFF \ | ||
-DBUILD_SHARED_LIBS=ON | ||
|
||
|
||
make %{makeprocesses} VERBOSE=1 | ||
|
||
%install | ||
cd ../build | ||
make %{makeprocesses} install VERBOSE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### RPM external pytorch-sparse 0.6.18 | ||
## INCLUDE compilation_flags | ||
## INCLUDE cpp-standard | ||
%define tag 2d559810c6af7f8b2cf88553dd5a5824a667a07d | ||
%define branch master | ||
%define github_user rusty1s | ||
|
||
Source: git+https://github.com/%{github_user}/pytorch_sparse.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz | ||
|
||
BuildRequires: cmake | ||
Requires: pytorch cudnn | ||
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} | ||
|
||
%prep | ||
%setup -n %{n}-%{realversion} | ||
# Make sure the default c++sdt stand is c++14 | ||
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt | ||
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt | ||
|
||
%build | ||
|
||
rm -rf ../build && mkdir ../build && cd ../build | ||
|
||
|
||
cmake ../%{n}-%{realversion} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=%{i} \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \ | ||
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
-DCMAKE_CXX_FLAGS="%{build_flags}" \ | ||
-DBUILD_TEST=OFF \ | ||
-DWITH_PYTHON=OFF \ | ||
-DWITH_CUDA=OFF \ | ||
-DBUILD_TEST=OFF \ | ||
-DBUILD_SHARED_LIBS=ON | ||
|
||
|
||
make %{makeprocesses} VERBOSE=1 | ||
|
||
%install | ||
cd ../build | ||
make %{makeprocesses} install VERBOSE=1 |
10 changes: 10 additions & 0 deletions
10
scram-tools.file/tools/pytorch-cluster/pytorch-cluster.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<tool name="pytorch-cluster" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="TORCH_CLUSTER_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="INCLUDE" default="$TORCH_CLUSTER_BASE/include"/> | ||
<environment name="INCLUDE" default="$TORCH_CLUSTER_BASE/include/torchcluster/"/> | ||
<environment name="LIBDIR" default="$TORCH_CLUSTER_BASE/lib"/> | ||
</client> | ||
<use name="pytorch"/> | ||
<lib name="torchcluster"/> | ||
</tool> |
6 changes: 6 additions & 0 deletions
6
scram-tools.file/tools/pytorch-custom-ops/pytorch-custom-ops.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<tool name="pytorch-custom-ops" version="1.0"> | ||
<use name="pytorch"/> | ||
<use name="pytorch-scatter"/> | ||
<use name="pytorch-cluster"/> | ||
<use name="pytorch-sparse"/> | ||
</tool> |
10 changes: 10 additions & 0 deletions
10
scram-tools.file/tools/pytorch-scatter/pytorch-scatter.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<tool name="pytorch-scatter" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="TORCH_SCATTER_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="INCLUDE" default="$TORCH_SCATTER_BASE/include"/> | ||
<environment name="INCLUDE" default="$TORCH_SCATTER_BASE/include/torchscatter/"/> | ||
<environment name="LIBDIR" default="$TORCH_SCATTER_BASE/lib"/> | ||
</client> | ||
<use name="pytorch"/> | ||
<lib name="torchscatter"/> | ||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<tool name="pytorch-sparse" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="TORCH_SPARSE_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="INCLUDE" default="$TORCH_SPARSE_BASE/include"/> | ||
<environment name="INCLUDE" default="$TORCH_SPARSE_BASE/include/torchsparse/"/> | ||
<environment name="LIBDIR" default="$TORCH_SPARSE_BASE/lib"/> | ||
</client> | ||
<use name="pytorch"/> | ||
<lib name="torchsparse"/> | ||
</tool> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valsdav , can you please update all the newly added xml files to have
PYTORCH_
instead ofTORCH_
e.g. replaceTORCH_CLUSTER_BASE
withPYTORCH_CLUSTER_BASE
every where. The name of this variable should match the name of tool.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 492ec08