From 80b5793accdf7fcd9d7626ffaa144baa58fbf1b2 Mon Sep 17 00:00:00 2001 From: C Date: Thu, 28 Dec 2023 18:39:05 +0800 Subject: [PATCH] support torch 2.3 (#94) * support torch 2.3 * bump version to 1.0.1 --- src/sfast/__init__.py | 2 +- src/sfast/csrc/operators/cublas/cublas_gemm.cpp | 6 ++++++ src/sfast/csrc/operators/fused_linear.cpp | 7 +++++++ version.txt | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/sfast/__init__.py b/src/sfast/__init__.py index 9d69698..e9de1f5 100644 --- a/src/sfast/__init__.py +++ b/src/sfast/__init__.py @@ -32,4 +32,4 @@ def new_lru_cache(*args, **kwargs): # This line will be programatically read/write by setup.py. # Leave them at the bottom of this file and don't touch them. -__version__ = "1.0.0" +__version__ = "1.0.1" diff --git a/src/sfast/csrc/operators/cublas/cublas_gemm.cpp b/src/sfast/csrc/operators/cublas/cublas_gemm.cpp index ad6ff47..2a4d01d 100644 --- a/src/sfast/csrc/operators/cublas/cublas_gemm.cpp +++ b/src/sfast/csrc/operators/cublas/cublas_gemm.cpp @@ -38,6 +38,12 @@ #include "CUDABlas.h" #include "cublas_gemm.h" +#if TORCH_VERSION_MAJOR >= 2 && TORCH_VERSION_MINOR >= 3 +namespace c10 { +static auto in_place = std::in_place; +} +#endif + namespace sfast { namespace operators { diff --git a/src/sfast/csrc/operators/fused_linear.cpp b/src/sfast/csrc/operators/fused_linear.cpp index 079db8c..4b7d19f 100644 --- a/src/sfast/csrc/operators/fused_linear.cpp +++ b/src/sfast/csrc/operators/fused_linear.cpp @@ -10,8 +10,15 @@ #include #include #include + #include "fused_linear.h" +#if TORCH_VERSION_MAJOR >= 2 && TORCH_VERSION_MINOR >= 3 +namespace c10 { +static auto in_place = std::in_place; +} +#endif + namespace sfast { namespace operators { diff --git a/version.txt b/version.txt index 3eefcb9..7dea76e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 +1.0.1