From 2b618fed059cbe2f9932f832964f0edc2b5a47cc Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 08:05:29 +0000 Subject: [PATCH 1/9] update --- pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp b/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp index f26ee13a..bd5099ca 100644 --- a/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp +++ b/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "parallel_hashmap/phmap.h" @@ -174,7 +175,9 @@ class NeighborSampler { // Case 3: Sample without replacement: else { auto index_tracker = IndexTracker(population); - if (population < (1 << 16)) { + if (false) { + // This logic is currently flawed since `arr` is not guaranteed to + // only contain unique values. const auto arr = std::move(generator.generate_range_of_ints(0, population, count)); for (auto i = 0; i < arr.size(); ++i) { From 7daf19734ede2f9aa405140c05da844056a08925 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 08:09:02 +0000 Subject: [PATCH 2/9] update --- CHANGELOG.md | 1 + pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4fb911a..85469f4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added - Added support for `bfloat16` data type in `segment_matmul` and `grouped_matmul` (CPU only) ([#272](https://github.com/pyg-team/pyg-lib/pull/272)) ### Changed +- Dropped the MKL code path when sampling neighbors with `replace=False` since it does not correctly prevent duplicates ([#275](https://github.com/pyg-team/pyg-lib/pull/275)) - Added `--biased` parameter to run benchmarks for biased sampling ([#267](https://github.com/pyg-team/pyg-lib/pull/267)) - Improved speed of biased sampling ([#270](https://github.com/pyg-team/pyg-lib/pull/270)) ### Removed diff --git a/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp b/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp index bd5099ca..307f9fe8 100644 --- a/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp +++ b/pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include "parallel_hashmap/phmap.h" From ea9fc918fa21ffaacd70067d91e0971f71adcc74 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:21:47 +0000 Subject: [PATCH 3/9] update --- pyg_lib/csrc/partition/cpu/metis_kernel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyg_lib/csrc/partition/cpu/metis_kernel.cpp b/pyg_lib/csrc/partition/cpu/metis_kernel.cpp index df516224..dab6e9d0 100644 --- a/pyg_lib/csrc/partition/cpu/metis_kernel.cpp +++ b/pyg_lib/csrc/partition/cpu/metis_kernel.cpp @@ -1,6 +1,10 @@ #include #include +#if defined(__linux__) && defined(__x86_64__) +__asm__(".symver pow,pow@GLIBC_2.2.5"); +#endif + #include namespace pyg { @@ -14,6 +18,8 @@ at::Tensor metis_kernel(const at::Tensor& rowptr, const c10::optional& node_weight, const c10::optional& edge_weight, bool recursive) { + return rowptr; + int64_t nvtxs = rowptr.numel() - 1; int64_t ncon = 1; auto* xadj = rowptr.data_ptr(); From 5e7e8f353422d9b8b3a5dd0888741b50f518a6c4 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:22:44 +0000 Subject: [PATCH 4/9] update --- CMakeLists.txt | 2 +- pyg_lib/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93ee338d..73e4f0af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12) project(pyg) set(CMAKE_CXX_STANDARD 17) -set(PYG_VERSION 0.3.0) +set(PYG_VERSION 0.3.1) option(BUILD_TEST "Enable testing" OFF) option(BUILD_BENCHMARK "Enable benchmarks" OFF) diff --git a/pyg_lib/__init__.py b/pyg_lib/__init__.py index 042162e5..573c008b 100644 --- a/pyg_lib/__init__.py +++ b/pyg_lib/__init__.py @@ -11,7 +11,7 @@ from .home import get_home_dir, set_home_dir -__version__ = '0.3.0' +__version__ = '0.3.1' # * `libpyg.so`: The name of the shared library file. # * `torch.ops.pyg`: The used namespace. diff --git a/setup.py b/setup.py index 0d78dc27..05d885ba 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import Extension, find_packages, setup from setuptools.command.build_ext import build_ext -__version__ = '0.3.0' +__version__ = '0.3.1' URL = 'https://github.com/pyg-team/pyg-lib' From c8e2879f39c6dea9d5e087ff1d6037ad51293e41 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:51:36 +0000 Subject: [PATCH 5/9] update --- .github/actions/setup/action.yml | 5 +++++ .github/workflows/python_testing.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index fc2dc521..1d7fdd06 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -47,6 +47,11 @@ runs: sed -i 's/;caffe2::cudnn-public//g' ${Torch_DIR}/Caffe2/Caffe2Targets.cmake shell: bash + - name: Downgrade GLIBC + run: | + sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver log,log@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/GKlib/gk_proto.h + sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver pow,pow@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/libmetis/metislib.h + - name: Install additional dependencies run: | pip install ninja wheel diff --git a/.github/workflows/python_testing.yml b/.github/workflows/python_testing.yml index ee84f862..b3b42085 100644 --- a/.github/workflows/python_testing.yml +++ b/.github/workflows/python_testing.yml @@ -27,3 +27,4 @@ jobs: - name: Run tests run: | pytest --cov --cov-report=xml + objdump -T libpyg.so | grep GLIBC_ From f316fb647b0d1454635b02978760e6d35b1aafbc Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:52:09 +0000 Subject: [PATCH 6/9] update --- pyg_lib/csrc/partition/cpu/metis_kernel.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pyg_lib/csrc/partition/cpu/metis_kernel.cpp b/pyg_lib/csrc/partition/cpu/metis_kernel.cpp index dab6e9d0..df516224 100644 --- a/pyg_lib/csrc/partition/cpu/metis_kernel.cpp +++ b/pyg_lib/csrc/partition/cpu/metis_kernel.cpp @@ -1,10 +1,6 @@ #include #include -#if defined(__linux__) && defined(__x86_64__) -__asm__(".symver pow,pow@GLIBC_2.2.5"); -#endif - #include namespace pyg { @@ -18,8 +14,6 @@ at::Tensor metis_kernel(const at::Tensor& rowptr, const c10::optional& node_weight, const c10::optional& edge_weight, bool recursive) { - return rowptr; - int64_t nvtxs = rowptr.numel() - 1; int64_t ncon = 1; auto* xadj = rowptr.data_ptr(); From 515de59555a1940a562de35a8562dc562c85ab58 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:53:39 +0000 Subject: [PATCH 7/9] update --- .github/actions/setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 1d7fdd06..9070b1f0 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -51,6 +51,7 @@ runs: run: | sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver log,log@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/GKlib/gk_proto.h sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver pow,pow@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/libmetis/metislib.h + shell: bash - name: Install additional dependencies run: | From a347feedc94935517b0ce8b5821f1b9635d0d722 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 13:59:51 +0000 Subject: [PATCH 8/9] update --- .github/workflows/documentation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e52d37a0..dbcf4078 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -14,6 +14,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Setup packages uses: ./.github/actions/setup From 4d97d575d933de96c33bde9c38942682983eb62e Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 9 Nov 2023 14:02:15 +0000 Subject: [PATCH 9/9] update --- .github/workflows/python_testing.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python_testing.yml b/.github/workflows/python_testing.yml index b3b42085..7e18ee6c 100644 --- a/.github/workflows/python_testing.yml +++ b/.github/workflows/python_testing.yml @@ -24,7 +24,10 @@ jobs: run: | pip install --verbose -e .[test] + - name: Print GLIBC dependency + run: | + objdump -T libpyg.so | grep GLIBC_ + - name: Run tests run: | pytest --cov --cov-report=xml - objdump -T libpyg.so | grep GLIBC_