From b844ac0bc149aa08efca75758a4e3026a735d9b7 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 17 Oct 2025 16:19:47 +0000 Subject: [PATCH 01/48] add rocm support Signed-off-by: tjtanaa --- .gitignore | 8 +- fastsafetensors/common.py | 5 + fastsafetensors/copier/gds.py | 17 ++- fastsafetensors/cpp/cuda_compat.h | 33 +++++ fastsafetensors/cpp/ext.cpp | 3 +- fastsafetensors/cpp/ext.hpp | 6 + fastsafetensors/dlpack.py | 22 +++- setup.py | 199 +++++++++++++++++++++++++++++- tests/conftest.py | 13 ++ tests/platform_utils.py | 81 ++++++++++++ tests/test_fastsafetensors.py | 6 + 11 files changed, 381 insertions(+), 12 deletions(-) create mode 100644 fastsafetensors/cpp/cuda_compat.h create mode 100644 tests/platform_utils.py diff --git a/.gitignore b/.gitignore index acc54b9..cbe6914 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,10 @@ htmlcov/ .vscode *.log *.pyc -examples/paddle_case/log \ No newline at end of file +*.so +examples/paddle_case/log + +# Auto-generated hipified files and directories (created during ROCm build) +fastsafetensors/cpp/hip/ +fastsafetensors/cpp/*.hip.* +fastsafetensors/cpp/hip_compat.h \ No newline at end of file diff --git a/fastsafetensors/common.py b/fastsafetensors/common.py index d369975..7dcd581 100644 --- a/fastsafetensors/common.py +++ b/fastsafetensors/common.py @@ -13,6 +13,11 @@ from .frameworks import FrameworkOpBase, TensorBase from .st_types import Device, DType +# Add compatibility alias for is_cuda_found -> is_hip_found +# This allows code written for CUDA to work transparently on both CUDA and ROCm +if not hasattr(fstcpp, 'is_cuda_found'): + fstcpp.is_cuda_found = fstcpp.is_hip_found + def get_device_numa_node(device: Optional[int]) -> Optional[int]: if device is None or not sys.platform.startswith("linux"): diff --git a/fastsafetensors/copier/gds.py b/fastsafetensors/copier/gds.py index 4dc1d7c..5f2ec3a 100644 --- a/fastsafetensors/copier/gds.py +++ b/fastsafetensors/copier/gds.py @@ -27,12 +27,17 @@ def __init__( self.fh: Optional[fstcpp.gds_file_handle] = None self.copy_reqs: Dict[int, int] = {} self.aligned_length = 0 - cudavers = list(map(int, framework.get_cuda_ver().split("."))) - # CUDA 12.2 (GDS version 1.7) introduces support for non O_DIRECT file descriptors - # Compatible with CUDA 11.x - self.o_direct = not ( - cudavers[0] > 12 or (cudavers[0] == 12 and cudavers[1] >= 2) - ) + cuda_ver = framework.get_cuda_ver() + if cuda_ver and cuda_ver != "None": + cudavers = list(map(int, cuda_ver.split("."))) + # CUDA 12.2 (GDS version 1.7) introduces support for non O_DIRECT file descriptors + # Compatible with CUDA 11.x + self.o_direct = not ( + cudavers[0] > 12 or (cudavers[0] == 12 and cudavers[1] >= 2) + ) + else: + # ROCm or non-CUDA platform, use O_DIRECT + self.o_direct = True def set_o_direct(self, enable: bool): self.o_direct = enable diff --git a/fastsafetensors/cpp/cuda_compat.h b/fastsafetensors/cpp/cuda_compat.h new file mode 100644 index 0000000..0c3cc69 --- /dev/null +++ b/fastsafetensors/cpp/cuda_compat.h @@ -0,0 +1,33 @@ +/* + * Copyright 2024 IBM Inc. All rights reserved + * SPDX-License-Identifier: Apache-2.0 + * + * CUDA/HIP compatibility layer for fastsafetensors + * Minimal compatibility header - only defines what hipify-perl doesn't handle + */ + +#pragma once + +// Platform detection - this gets hipified to check __HIP_PLATFORM_AMD__ +#ifdef __HIP_PLATFORM_AMD__ + #ifndef USE_ROCM + #define USE_ROCM + #endif + #include +#else + // For CUDA platform, or when CUDA headers aren't available, we define minimal types in ext.hpp +#endif + +// Runtime library name - hipify-perl doesn't change string literals +#ifdef USE_ROCM + #define GPU_RUNTIME_LIB "libamdhip64.so" +#else + #define GPU_RUNTIME_LIB "libcudart.so" +#endif + +// Custom function pointer names that hipify-perl doesn't recognize +// These are our own naming in ext_funcs struct, not standard CUDA API +#ifdef USE_ROCM + #define cudaDeviceMalloc hipDeviceMalloc + #define cudaDeviceFree hipDeviceFree +#endif diff --git a/fastsafetensors/cpp/ext.cpp b/fastsafetensors/cpp/ext.cpp index 4f08894..f48d937 100644 --- a/fastsafetensors/cpp/ext.cpp +++ b/fastsafetensors/cpp/ext.cpp @@ -10,6 +10,7 @@ #include #include +#include "cuda_compat.h" #include "ext.hpp" #define ALIGN 4096 @@ -89,7 +90,7 @@ template void mydlsym(T** h, void* lib, std::string const& name) { static void load_nvidia_functions() { cudaError_t (*cudaGetDeviceCount)(int*); const char* cufileLib = "libcufile.so.0"; - const char* cudartLib = "libcudart.so"; + const char* cudartLib = GPU_RUNTIME_LIB; const char* numaLib = "libnuma.so.1"; bool init_log = getenv(ENV_ENABLE_INIT_LOG); int mode = RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE; diff --git a/fastsafetensors/cpp/ext.hpp b/fastsafetensors/cpp/ext.hpp index eafd24c..2f7c5d9 100644 --- a/fastsafetensors/cpp/ext.hpp +++ b/fastsafetensors/cpp/ext.hpp @@ -15,6 +15,8 @@ #include #include +#include "cuda_compat.h" + #define ENV_ENABLE_INIT_LOG "FASTSAFETENSORS_ENABLE_INIT_LOG" #ifndef __MOD_NAME__ @@ -33,8 +35,12 @@ typedef struct CUfileDescr_t { const void *fs_ops; /* CUfileFSOps_t */ } CUfileDescr_t; typedef struct CUfileError { CUfileOpError err; } CUfileError_t; + +// Only define minimal CUDA types if not using ROCm (where real headers are included) +#ifndef USE_ROCM typedef enum cudaError { cudaSuccess = 0, cudaErrorMemoryAllocation = 2 } cudaError_t; enum cudaMemcpyKind { cudaMemcpyHostToDevice=2, cudaMemcpyDefault = 4 }; +#endif typedef enum CUfileFeatureFlags { diff --git a/fastsafetensors/dlpack.py b/fastsafetensors/dlpack.py index 007487a..1d4338e 100644 --- a/fastsafetensors/dlpack.py +++ b/fastsafetensors/dlpack.py @@ -12,6 +12,23 @@ _c_str_dltensor = b"dltensor" +# Detect GPU type at module load time +def _detect_gpu_type(): + """Detect if we're running on ROCm or CUDA""" + try: + import torch + if torch.cuda.is_available(): + # Check if this is ROCm build + if hasattr(torch.version, 'hip') and torch.version.hip is not None: + return 10 # kDLROCM + except: + pass + return 2 # kDLCUDA + + +_GPU_DEVICE_TYPE = _detect_gpu_type() + + class DLDevice(ctypes.Structure): def __init__(self, dev: Device): self.device_type = self.DeviceToDL[dev.type] @@ -19,6 +36,7 @@ def __init__(self, dev: Device): kDLCPU = 1 kDLCUDA = 2 + kDLROCM = 10 _fields_ = [ ("device_type", ctypes.c_int), ("device_id", ctypes.c_int), @@ -26,8 +44,8 @@ def __init__(self, dev: Device): DeviceToDL = { DeviceType.CPU: kDLCPU, - DeviceType.CUDA: kDLCUDA, - DeviceType.GPU: kDLCUDA, + DeviceType.CUDA: _GPU_DEVICE_TYPE, + DeviceType.GPU: _GPU_DEVICE_TYPE, } diff --git a/setup.py b/setup.py index b052909..adecf4e 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,132 @@ # SPDX-License-Identifier: Apache-2.0 import os +import re +import shutil +from pathlib import Path from setuptools import Extension, setup +from setuptools.command.build_ext import build_ext -def MyExtension(name, sources, mod_name, *args, **kwargs): +def detect_platform(): + """ + Detect if we're on NVIDIA CUDA or AMD ROCm platform. + + Returns: + tuple: (platform_type, rocm_version, rocm_path) + platform_type: 'cuda' or 'rocm' + rocm_version: ROCm version string (e.g., '7.0.1') or None + rocm_path: Path to ROCm installation or None + """ + # Check for ROCm installation + rocm_path = os.environ.get("ROCM_PATH") + if not rocm_path: + # Try common ROCm installation paths + for path in ["/opt/rocm", "/opt/rocm-*"]: + if "*" in path: + import glob + matches = sorted(glob.glob(path), reverse=True) + if matches: + rocm_path = matches[0] + break + elif os.path.exists(path): + rocm_path = path + break + + # Check if ROCm is available + if rocm_path and os.path.exists(rocm_path): + # Detect ROCm version + rocm_version = None + version_file = os.path.join(rocm_path, ".info", "version") + if os.path.exists(version_file): + with open(version_file, "r") as f: + rocm_version = f.read().strip() + else: + # Try to extract version from path + match = re.search(r'rocm[-/](\d+\.\d+(?:\.\d+)?)', rocm_path) + if match: + rocm_version = match.group(1) + + print(f"Detected ROCm platform at {rocm_path}") + if rocm_version: + print(f"ROCm version: {rocm_version}") + return ('rocm', rocm_version, rocm_path) + + # Check for CUDA + cuda_home = os.environ.get("CUDA_HOME") or os.environ.get("CUDA_PATH") + if not cuda_home: + # Try to find nvcc + nvcc_path = shutil.which("nvcc") + if nvcc_path: + cuda_home = os.path.dirname(os.path.dirname(nvcc_path)) + + if cuda_home and os.path.exists(cuda_home): + print(f"Detected CUDA platform at {cuda_home}") + return ('cuda', None, None) + + # Default to CUDA if nothing detected + print("No GPU platform detected, defaulting to CUDA") + return ('cuda', None, None) + + +def hipify_source_files(rocm_path): + """ + Automatically hipify CUDA source files to HIP using torch.utils.hipify. + The cuda_compat.h header handles what hipify doesn't convert. + + Args: + rocm_path: Path to ROCm installation + + Returns: + list: Paths to hipified source files + """ + from torch.utils.hipify.hipify_python import hipify + + cpp_dir = Path("fastsafetensors/cpp").resolve() + + # Prepare source files for hipification + extra_files = [ + str(cpp_dir / "ext.cpp"), + str(cpp_dir / "ext.hpp"), + ] + + print(f"Hipifying files using torch.utils.hipify:") + for f in extra_files: + print(f" - {f}") + + # Use torch's hipify - similar to vLLM's approach + hipify_result = hipify( + project_directory=str(cpp_dir.parent), + output_directory=str(cpp_dir), + header_include_dirs=[], + includes=[f"{cpp_dir}/*"], + extra_files=extra_files, + show_detailed=False, + is_pytorch_extension=False, + hipify_extra_files_only=True, + ) + + hipified_files = [] + for source_path, result in hipify_result.items(): + if hasattr(result, 'hipified_path') and result.hipified_path: + print(f"Successfully hipified: {source_path} -> {result.hipified_path}") + hipified_files.append(result.hipified_path) + + # Copy cuda_compat.h to hip directory as hip_compat.h + # (hipify converts the include statement from cuda_compat.h to hip_compat.h) + hip_dir = cpp_dir / "hip" + if hip_dir.exists(): + cuda_compat = cpp_dir / "cuda_compat.h" + hip_compat = hip_dir / "hip_compat.h" + shutil.copy2(cuda_compat, hip_compat) + print(f"Copied {cuda_compat} -> {hip_compat}") + + return hipified_files + + + +def MyExtension(name, sources, mod_name, platform_type, rocm_path=None, *args, **kwargs): import pybind11 pybind11_path = os.path.dirname(pybind11.__file__) @@ -21,9 +142,78 @@ def MyExtension(name, sources, mod_name, *args, **kwargs): # https://pybind11.readthedocs.io/en/stable/faq.html#someclass-declared-with-greater-visibility-than-the-type-of-its-field-someclass-member-wattributes kwargs["extra_compile_args"] = ["-fvisibility=hidden", "-std=c++17"] + # Platform-specific configuration + if platform_type == 'rocm' and rocm_path: + # ROCm/HIP configuration + kwargs["define_macros"].append(("__HIP_PLATFORM_AMD__", "1")) + kwargs["libraries"].append("amdhip64") + kwargs["library_dirs"] = [f"{rocm_path}/lib"] + kwargs["include_dirs"].append(f"{rocm_path}/include") + kwargs["extra_compile_args"].append("-D__HIP_PLATFORM_AMD__") + kwargs["extra_link_args"] = [f"-L{rocm_path}/lib", "-lamdhip64"] + return Extension(name, sources, *args, **kwargs) +class CustomBuildExt(build_ext): + """Custom build_ext to handle automatic hipification for ROCm platforms""" + + def run(self): + # Detect platform + platform_type, rocm_version, rocm_path = detect_platform() + + # Store platform info + self.platform_type = platform_type + self.rocm_version = rocm_version + self.rocm_path = rocm_path + + # Configure build based on platform + if platform_type == 'rocm' and rocm_path: + print("=" * 60) + print("Building for AMD ROCm platform") + if rocm_version: + print(f"ROCm version: {rocm_version}") + print("=" * 60) + + # Hipify sources + hipify_source_files(rocm_path) + + # Update extension sources to use hipified files + for ext in self.extensions: + new_sources = [] + for src in ext.sources: + if 'fastsafetensors/cpp/ext.cpp' in src: + # torch.utils.hipify creates files in hip/ subdirectory + new_sources.append(src.replace('fastsafetensors/cpp/ext.cpp', 'fastsafetensors/cpp/hip/ext.cpp')) + else: + new_sources.append(src) + ext.sources = new_sources + + # Update include dirs to include hip/ subdirectory + ext.include_dirs.append("fastsafetensors/cpp/hip") + + # Update extension with ROCm-specific settings + ext.define_macros.append(("__HIP_PLATFORM_AMD__", "1")) + ext.define_macros.append(("USE_ROCM", "1")) + ext.libraries.append("amdhip64") + ext.library_dirs = [f"{rocm_path}/lib"] + ext.include_dirs.append(f"{rocm_path}/include") + ext.extra_compile_args.append("-D__HIP_PLATFORM_AMD__") + ext.extra_compile_args.append("-DUSE_ROCM") + ext.extra_link_args = [f"-L{rocm_path}/lib", "-lamdhip64"] + else: + print("=" * 60) + print("Building for NVIDIA CUDA platform") + print("=" * 60) + + # Continue with normal build + build_ext.run(self) + + +# Detect platform for package_data +platform_type, _, rocm_path_detected = detect_platform() +package_data_patterns = ["*.hpp", "*.h", "cpp.pyi"] + setup( packages=[ "fastsafetensors", @@ -32,13 +222,18 @@ def MyExtension(name, sources, mod_name, *args, **kwargs): "fastsafetensors.frameworks", ], include_package_data=True, - package_data={"fastsafetensors.cpp": ["*.hpp", "cpp.pyi"]}, + package_data={"fastsafetensors.cpp": package_data_patterns}, ext_modules=[ MyExtension( name=f"fastsafetensors.cpp", sources=["fastsafetensors/cpp/ext.cpp"], include_dirs=["fastsafetensors/cpp"], mod_name="cpp", + platform_type=platform_type, + rocm_path=rocm_path_detected, ) ], + cmdclass={ + 'build_ext': CustomBuildExt, + }, ) diff --git a/tests/conftest.py b/tests/conftest.py index 96d2f95..5960d3c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import os +import sys from typing import List import pytest @@ -9,7 +10,10 @@ from fastsafetensors.frameworks import FrameworkOpBase, get_framework_op from fastsafetensors.st_types import Device +# Add tests directory to path to import platform_utils TESTS_DIR = os.path.dirname(__file__) +sys.path.insert(0, TESTS_DIR) +from platform_utils import get_platform_info, is_rocm_platform REPO_ROOT = os.path.dirname(os.path.dirname(TESTS_DIR)) DATA_DIR = os.path.join(REPO_ROOT, ".testdata") TF_DIR = os.path.join(DATA_DIR, "transformers_cache") @@ -20,6 +24,15 @@ load_nvidia_functions() FRAMEWORK = get_framework_op(os.getenv("TEST_FASTSAFETENSORS_FRAMEWORK", "please set")) +# Print platform information at test startup +platform_info = get_platform_info() +print("\n" + "=" * 60) +print("Platform Detection:") +print("=" * 60) +for key, value in platform_info.items(): + print(f" {key}: {value}") +print("=" * 60 + "\n") + @pytest.fixture(scope="session", autouse=True) def framework() -> FrameworkOpBase: diff --git a/tests/platform_utils.py b/tests/platform_utils.py new file mode 100644 index 0000000..a7c8c31 --- /dev/null +++ b/tests/platform_utils.py @@ -0,0 +1,81 @@ +# Copyright 2024 IBM Inc. All rights reserved +# SPDX-License-Identifier: Apache-2.0 + +"""Utilities for platform detection and conditional test execution.""" + +import pytest + + +def is_rocm_platform(): + """Detect if running on ROCm/AMD platform.""" + try: + import torch + if torch.cuda.is_available(): + if hasattr(torch.version, 'hip') and torch.version.hip is not None: + return True + except: + pass + return False + + +def is_cuda_platform(): + """Detect if running on CUDA/NVIDIA platform.""" + return not is_rocm_platform() + + +# List of tests that are expected to fail on ROCm (based on TEST_RESULTS.md) +ROCM_EXPECTED_FAILURES = { + 'test_GdsFileCopier', # GDS not available on AMD +} + +# List of tests with memory leak detection issues on ROCm (non-critical) +ROCM_MEMORY_LEAK_TESTS = { + 'test_SafeTensorsFileLoader', + 'test_SafeTensorsFileLoaderNoGds', + 'test_fastsafe_open', + 'test_int8', + 'test_float8_e5m2', + 'test_float8_e4m3fn', + 'test_float8_e4m3fn_to_int8', + 'test_cpp_metrics', +} + + +def skip_if_rocm_expected_failure(test_name): + """Skip test if it's an expected failure on ROCm.""" + if is_rocm_platform() and test_name in ROCM_EXPECTED_FAILURES: + pytest.skip(f"Test '{test_name}' is expected to fail on ROCm (GDS not supported)") + + +def xfail_if_rocm_memory_leak(test_name): + """Mark test as expected to fail on ROCm due to memory leak detection issues.""" + if is_rocm_platform() and test_name in ROCM_MEMORY_LEAK_TESTS: + return pytest.mark.xfail( + reason=f"Test '{test_name}' has memory leak detection issues on ROCm (non-critical)", + strict=False + ) + return lambda func: func + + +def get_platform_info(): + """Get platform information for debugging.""" + info = { + 'is_rocm': is_rocm_platform(), + 'is_cuda': is_cuda_platform(), + } + + try: + import torch + if torch.cuda.is_available(): + info['torch_version'] = torch.__version__ + if is_rocm_platform(): + info['hip_version'] = torch.version.hip + info['rocm_version'] = torch.version.hip + else: + info['cuda_version'] = torch.version.cuda + info['device_count'] = torch.cuda.device_count() + info['device_name'] = torch.cuda.get_device_name(0) if torch.cuda.device_count() > 0 else None + except: + pass + + return info diff --git a/tests/test_fastsafetensors.py b/tests/test_fastsafetensors.py index dcbdccd..1606571 100644 --- a/tests/test_fastsafetensors.py +++ b/tests/test_fastsafetensors.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +import sys from collections import OrderedDict from typing import Any, Dict, List, Tuple @@ -17,6 +18,10 @@ from fastsafetensors.frameworks import FrameworkOpBase from fastsafetensors.st_types import Device, DeviceType, DType +# Add tests directory to path to import platform_utils +sys.path.insert(0, os.path.dirname(__file__)) +from platform_utils import skip_if_rocm_expected_failure + def load_safetensors_file( filename: str, @@ -326,6 +331,7 @@ def test_NoGdsFileCopier(fstcpp_log, input_files, framework) -> None: def test_GdsFileCopier(fstcpp_log, input_files, framework) -> None: print("test_GdsFileCopier") + skip_if_rocm_expected_failure("test_GdsFileCopier") meta = SafeTensorsMetadata.from_file(input_files[0], framework) device, dev_is_gpu = get_and_check_device(framework) reader = fstcpp.gds_file_reader(4, dev_is_gpu) From 73b2674c43d4dd5663310682fd0f4d40e73ea5e6 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Sun, 19 Oct 2025 05:55:20 +0000 Subject: [PATCH 02/48] add rocm documentation Signed-off-by: tjtanaa --- README.md | 16 ++++++++-- docs/amd-perf.md | 43 +++++++++++++++++++++++++++ docs/images/fastsafetensors-rocm.png | Bin 0 -> 54504 bytes 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 docs/amd-perf.md create mode 100644 docs/images/fastsafetensors-rocm.png diff --git a/README.md b/README.md index bcacbce..c692e10 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,9 @@ Please refer to [Foundation Model Stack Community Code of Conduct](https://githu Takeshi Yoshimura, Tatsuhiro Chiba, Manish Sethi, Daniel Waddington, Swaminathan Sundararaman. (2025) Speeding up Model Loading with fastsafetensors [arXiv:2505.23072](https://arxiv.org/abs/2505.23072) and IEEE CLOUD 2025. +## For NVIDIA -## Install from PyPI +### Install from PyPI See https://pypi.org/project/fastsafetensors/ @@ -57,8 +58,19 @@ See https://pypi.org/project/fastsafetensors/ pip install fastsafetensors ``` -## Install from source +### Install from source ```bash pip install . ``` + +## For ROCm + +### Install from source + +On ROCm, there are not GDS equivalent support. So fastsafetensors support only supports `nogds=True` mode. +The performance gain example can be found at [amd-perf.md](./docs/amd-perf.md) + +```bash +python3 setup.py develop +``` diff --git a/docs/amd-perf.md b/docs/amd-perf.md new file mode 100644 index 0000000..433ff59 --- /dev/null +++ b/docs/amd-perf.md @@ -0,0 +1,43 @@ +# Performance of safetensors on AMD GPUs + +## DeepSeek-R1 vLLM Model Weight Loading Speed + +This benchmark compares the performance of `safetensors` vs `fastsafetensors` when loading model weights on AMD GPUs. + +NOTES: `fastsafetensors` does not support GDS feature on ROCm as there are no GDS alternative on ROCm. + +### Benchmark Methodology + +1. **Clear system cache** to ensure consistent starting conditions: + ```bash + sudo sh -c 'sync && echo 3 > /proc/sys/vm/drop_caches' + ``` + +2. **Launch vLLM** with either `--load-format safetensors` or `--load-format fastsafetensors`: + + ```bash + MODEL=EmbeddedLLM/deepseek-r1-FP8-Dynamic + + VLLM_USE_V1=1 \ + VLLM_ROCM_USE_AITER=1 \ + vllm serve $MODEL \ + --tensor-parallel-size 8 \ + --disable-log-requests \ + --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE"}' \ + --trust-remote-code \ + --load-format fastsafetensors \ + --block-size 1 + ``` + +### Results + +The experiments are carried on MI300X. + +**Cache Scenarios:** +- **No cache**: Model weights are loaded after clearing the system cache (cold start). +- **Cached**: Model weights are loaded immediately after a previous load. The weights are cached in the filesystem and RAM (warm start). + +FastSafeTensors on ROCm + + + diff --git a/docs/images/fastsafetensors-rocm.png b/docs/images/fastsafetensors-rocm.png new file mode 100644 index 0000000000000000000000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u4wG@ z=cP~;rsn1+ke0+@N!)Z8L8u00E=Y=U@@-W21<58^pzd;(`d{HRHx!RGS2YzC9F+>I ze^c$i6Z`%-p!Hvq>wkXq|9db0|DbgscW%+gYTENnt(S4~n4&DqtW9s2Fr)qlddjJd literal 0 HcmV?d00001 From 663e8b6c35e08136451f5de9f2c582ef92ccafc9 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Sun, 19 Oct 2025 06:04:14 +0000 Subject: [PATCH 03/48] add amd perf benchmark data Signed-off-by: tjtanaa --- docs/amd-perf.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/docs/amd-perf.md b/docs/amd-perf.md index 433ff59..ea60664 100644 --- a/docs/amd-perf.md +++ b/docs/amd-perf.md @@ -1,4 +1,4 @@ -# Performance of safetensors on AMD GPUs +# Performance of FastSafeTensors on AMD GPUs ## DeepSeek-R1 vLLM Model Weight Loading Speed @@ -8,6 +8,10 @@ NOTES: `fastsafetensors` does not support GDS feature on ROCm as there are no GD ### Benchmark Methodology +**Platform:** AMD ROCm 7.0.1 +**GPUs:** 8x AMD Instinct MI300X +**Library:** fastsafetensors 0.1.15 + 1. **Clear system cache** to ensure consistent starting conditions: ```bash sudo sh -c 'sync && echo 3 > /proc/sys/vm/drop_caches' @@ -41,3 +45,44 @@ The experiments are carried on MI300X. + +## GPT-2 perf tests based on the script [perf/fastsafetensors_perf/perf.py](../perf/fastsafetensors_perf/perf.py) + +### Test Configuration + +All tests were performed on single-GPU loading scenarios with two different model sizes: +- **GPT-2 (small):** 523MB safetensors file +- **GPT-2 Medium:** ~1.4GB safetensors file + +#### Key Parameters Tested: +- **nogds mode:** ROCm fallback (GDS not available on AMD GPUs) +- **Thread counts:** 8, 16, 32 +- **Buffer sizes:** 8MB, 16MB, 32MB +- **Loading methods:** nogds (async I/O), mmap (memory-mapped) +- **Data types:** AUTO (no conversion), F16 (half precision conversion) + +--- + +#### Performance Results + +##### GPT-2 (523MB) - Single GPU Tests + +| Test # | Method | Threads | Buffer | Config | Bandwidth | Elapsed Time | Notes | +|--------|--------|---------|--------|--------|-----------|--------------|-------| +| 1 | nogds | 16 | 16MB | default | **1.91 GB/s** | 0.268s | Baseline test | +| 2 | nogds | 32 | 32MB | default | **2.07 GB/s** | 0.246s | Higher threads/buffer | +| 3 | nogds | 8 | 8MB | default | **2.10 GB/s** | 0.243s | Lower threads/buffer | +| 4 | mmap | N/A | N/A | default | **1.01 GB/s** | 0.505s | Memory-mapped | +| 5 | nogds | 32 | 32MB | cache-drop | **1.24 GB/s** | 0.410s | Cold cache test | +| 6 | nogds | 32 | 32MB | F16 dtype | **0.77 GB/s** | 0.332s | With type conversion | +| 8 | nogds | 16 | 16MB | **optimal** | **2.62 GB/s** | 0.195s | Best config | + +##### GPT-2 Medium (1.4GB) - Single GPU Tests + +| Test # | Method | Threads | Buffer | Block Size | Bandwidth | Elapsed Time | Notes | +|--------|--------|---------|--------|------------|-----------|--------------|-------| +| 9 | nogds | 16 | 16MB | 160MB | **6.02 GB/s** | 0.235s | Optimal config | +| 10 | mmap | N/A | N/A | N/A | **1.28 GB/s** | 1.104s | Memory-mapped | +| 11 | nogds | 32 | 32MB | 160MB | **5.34 GB/s** | 0.265s | Higher threads | + +--- \ No newline at end of file From 93e247ead66d53bcf01ed337c758afe0df0dab87 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Mon, 20 Oct 2025 06:08:42 +0000 Subject: [PATCH 04/48] fix image Signed-off-by: tjtanaa --- docs/images/fastsafetensors-rocm.png | Bin 54504 -> 50678 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/images/fastsafetensors-rocm.png b/docs/images/fastsafetensors-rocm.png index 526b695e16aa4716a590668d9f9b08e34d1c43c8..7bc23242b2ce37a90dc223eed03e4269dc087a22 100644 GIT binary patch delta 21353 zcmcG$2UHYW8!g!8fPjIZC~%b|AfPBYsfgGjIcJe1P0r8=g$b@8piPpTV?!eux(Nyj z0s<16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pv=%dDt%?KxCe=QRcxolr~t`h>G+^F3`T6ApLZ|>!NxAINk!EhfRit7W zXINl2Db~ds34fwuRDEB^XW=TkgZXWq5bI z9nkO~IJH-A!`%77vj{rC<_2-JTFGxCe@5-l-fLWTa#|i4hw##zoE*Q=`W>AE1L4re zx`@(mX0{aS4tt!PY~akqH&3doiW3TJR-Jj**Vnf%kQX>`Xnws(QQ*2~VM^s49in(V z#Vhr|&CSPGS?0O~1CDeTe!GLRC>`~=9JkhuP&j$RxBL?5Yt9M>d-_B;QN5G)!Gn@S zuD$W<>+sYV-H5N+QBU1ukz@V)ECA^gu!2te_O6F|CtpRerDHZyzYMh(1p@nRP+eS7>5 zfSW}bmbr^8Gt7W3&O_l3bAEe|^Fp<8+9Yby-7K3hR>*$;ZPzgnX+~tjER0S~%T%(x$8P$L#q_*a(x+-D)-;p(i zfs;*4FCWD From 962010c670220c8a6f33b763a47e3f1d1bb79ced Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 24 Oct 2025 06:17:12 +0000 Subject: [PATCH 05/48] address reviewer feedback Signed-off-by: tjtanaa --- fastsafetensors/common.py | 12 ++-- fastsafetensors/cpp/cuda_compat.h | 14 ++-- fastsafetensors/cpp/ext.cpp | 40 +++++++++++- fastsafetensors/cpp/ext.hpp | 5 +- fastsafetensors/dlpack.py | 47 ++++++++------ fastsafetensors/frameworks/_torch.py | 13 +++- fastsafetensors/loader.py | 8 ++- setup.py | 31 +++++---- tests/conftest.py | 4 +- tests/platform_utils.py | 95 ++++++++++++++++++---------- tests/test_fastsafetensors.py | 35 ++++++---- tests/test_multi.py | 5 +- 12 files changed, 214 insertions(+), 95 deletions(-) diff --git a/fastsafetensors/common.py b/fastsafetensors/common.py index 7dcd581..33446a0 100644 --- a/fastsafetensors/common.py +++ b/fastsafetensors/common.py @@ -13,10 +13,14 @@ from .frameworks import FrameworkOpBase, TensorBase from .st_types import Device, DType -# Add compatibility alias for is_cuda_found -> is_hip_found -# This allows code written for CUDA to work transparently on both CUDA and ROCm -if not hasattr(fstcpp, 'is_cuda_found'): - fstcpp.is_cuda_found = fstcpp.is_hip_found + +def is_gpu_found(): + """Check if any GPU (CUDA or HIP) is available. + + Returns True if either CUDA or ROCm/HIP GPUs are detected. + This allows code to work transparently across both platforms. + """ + return fstcpp.is_cuda_found() or fstcpp.is_hip_found() def get_device_numa_node(device: Optional[int]) -> Optional[int]: diff --git a/fastsafetensors/cpp/cuda_compat.h b/fastsafetensors/cpp/cuda_compat.h index 0c3cc69..f430ec3 100644 --- a/fastsafetensors/cpp/cuda_compat.h +++ b/fastsafetensors/cpp/cuda_compat.h @@ -1,21 +1,25 @@ +// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2024 IBM Inc. All rights reserved - * SPDX-License-Identifier: Apache-2.0 * * CUDA/HIP compatibility layer for fastsafetensors * Minimal compatibility header - only defines what hipify-perl doesn't handle */ -#pragma once +#ifndef __CUDA_COMPAT_H__ +#define __CUDA_COMPAT_H__ // Platform detection - this gets hipified to check __HIP_PLATFORM_AMD__ #ifdef __HIP_PLATFORM_AMD__ #ifndef USE_ROCM #define USE_ROCM #endif - #include + // Note: We do NOT include here to avoid compile-time dependencies. + // Instead, we dynamically load the ROCm runtime library (libamdhip64.so) at runtime + // using dlopen(), just like we do for CUDA (libcudart.so). + // Minimal types are defined in ext.hpp. #else - // For CUDA platform, or when CUDA headers aren't available, we define minimal types in ext.hpp + // For CUDA platform, we also avoid including headers and define minimal types in ext.hpp #endif // Runtime library name - hipify-perl doesn't change string literals @@ -31,3 +35,5 @@ #define cudaDeviceMalloc hipDeviceMalloc #define cudaDeviceFree hipDeviceFree #endif + +#endif // __CUDA_COMPAT_H__ diff --git a/fastsafetensors/cpp/ext.cpp b/fastsafetensors/cpp/ext.cpp index f48d937..bd15650 100644 --- a/fastsafetensors/cpp/ext.cpp +++ b/fastsafetensors/cpp/ext.cpp @@ -79,6 +79,7 @@ ext_funcs_t cpu_fns = ext_funcs_t { ext_funcs_t cuda_fns; static bool cuda_found = false; +static bool is_hip_runtime = false; // Track if we loaded HIP (not auto-hipified) static bool cufile_found = false; static int cufile_ver = 0; @@ -123,8 +124,12 @@ static void load_nvidia_functions() { count = 0; // why cudaGetDeviceCount returns non-zero for errors? } cuda_found = count > 0; + // Detect if we loaded HIP runtime (ROCm) vs CUDA runtime + if (cuda_found && std::string(cudartLib).find("hip") != std::string::npos) { + is_hip_runtime = true; + } if (init_log) { - fprintf(stderr, "[DEBUG] device count=%d, cuda_found=%d\n", count, cuda_found); + fprintf(stderr, "[DEBUG] device count=%d, cuda_found=%d, is_hip_runtime=%d\n", count, cuda_found, is_hip_runtime); } } else { cuda_found = false; @@ -218,11 +223,28 @@ static void load_nvidia_functions() { } } +// Note: is_cuda_found gets auto-hipified to is_hip_found on ROCm builds +// So this function will be is_hip_found() after hipification on ROCm bool is_cuda_found() { return cuda_found; } +// Separate function that always returns false on ROCm (CUDA not available on ROCm) +// This will be used for the "is_cuda_found" Python export on ROCm builds +bool cuda_not_available() +{ + return false; // On ROCm, CUDA is never available +} + +// Separate function for checking HIP runtime detection (not hipified) +// On CUDA: checks if HIP runtime was detected +// On ROCm: not used (is_cuda_found gets hipified to is_hip_found) +bool check_hip_runtime() +{ + return is_hip_runtime; +} + bool is_cufile_found() { return cufile_found; @@ -719,7 +741,21 @@ cpp_metrics_t get_cpp_metrics() { PYBIND11_MODULE(__MOD_NAME__, m) { - m.def("is_cuda_found", &is_cuda_found); + // Export both is_cuda_found and is_hip_found on all platforms + // Use string concatenation to prevent hipify from converting the export names +#ifdef USE_ROCM + // On ROCm after hipify: + // - is_cuda_found() becomes is_hip_found(), so export it as "is_hip_found" + // - Export cuda_not_available() as "is_cuda_found" (CUDA not available on ROCm) + m.def(("is_" "cuda" "_found"), &cuda_not_available); // Returns false on ROCm + m.def(("is_" "hip" "_found"), &is_cuda_found); // hipified to is_hip_found, returns hip status +#else + // On CUDA: + // - is_cuda_found() checks for CUDA + // - check_hip_runtime() checks if HIP runtime was loaded + m.def(("is_" "cuda" "_found"), &is_cuda_found); + m.def(("is_" "hip" "_found"), &check_hip_runtime); +#endif m.def("is_cufile_found", &is_cufile_found); m.def("cufile_version", &cufile_version); m.def("set_debug_log", &set_debug_log); diff --git a/fastsafetensors/cpp/ext.hpp b/fastsafetensors/cpp/ext.hpp index 2f7c5d9..961011f 100644 --- a/fastsafetensors/cpp/ext.hpp +++ b/fastsafetensors/cpp/ext.hpp @@ -36,11 +36,10 @@ typedef struct CUfileDescr_t { } CUfileDescr_t; typedef struct CUfileError { CUfileOpError err; } CUfileError_t; -// Only define minimal CUDA types if not using ROCm (where real headers are included) -#ifndef USE_ROCM +// Define minimal CUDA/HIP types for both platforms to avoid compile-time dependencies +// We load all GPU functions dynamically at runtime via dlopen() typedef enum cudaError { cudaSuccess = 0, cudaErrorMemoryAllocation = 2 } cudaError_t; enum cudaMemcpyKind { cudaMemcpyHostToDevice=2, cudaMemcpyDefault = 4 }; -#endif typedef enum CUfileFeatureFlags { diff --git a/fastsafetensors/dlpack.py b/fastsafetensors/dlpack.py index 1d4338e..e8883ed 100644 --- a/fastsafetensors/dlpack.py +++ b/fastsafetensors/dlpack.py @@ -12,26 +12,43 @@ _c_str_dltensor = b"dltensor" -# Detect GPU type at module load time +# Lazy GPU type detection - avoid calling framework-specific code at module load time +_GPU_DEVICE_TYPE = None # Will be detected lazily + + def _detect_gpu_type(): - """Detect if we're running on ROCm or CUDA""" - try: - import torch - if torch.cuda.is_available(): - # Check if this is ROCm build - if hasattr(torch.version, 'hip') and torch.version.hip is not None: - return 10 # kDLROCM - except: - pass + """Detect if we're running on ROCm or CUDA. + + This detection is now done lazily to avoid framework-specific calls at module load time. + Uses the C++ extension's is_hip_found() to determine the platform. + """ + # Import here to avoid circular dependency + from . import cpp as fstcpp + + # Check if we loaded HIP runtime (ROCm) + if fstcpp.is_hip_found(): + return 10 # kDLROCM return 2 # kDLCUDA -_GPU_DEVICE_TYPE = _detect_gpu_type() +def _get_gpu_device_type(): + """Get the GPU device type, detecting it lazily if needed.""" + global _GPU_DEVICE_TYPE + if _GPU_DEVICE_TYPE is None: + _GPU_DEVICE_TYPE = _detect_gpu_type() + return _GPU_DEVICE_TYPE class DLDevice(ctypes.Structure): def __init__(self, dev: Device): - self.device_type = self.DeviceToDL[dev.type] + # Use lazy detection to get the GPU device type + gpu_type = _get_gpu_device_type() + device_to_dl = { + DeviceType.CPU: self.kDLCPU, + DeviceType.CUDA: gpu_type, + DeviceType.GPU: gpu_type, + } + self.device_type = device_to_dl[dev.type] self.device_id = dev.index if dev.index is not None else 0 kDLCPU = 1 @@ -42,12 +59,6 @@ def __init__(self, dev: Device): ("device_id", ctypes.c_int), ] - DeviceToDL = { - DeviceType.CPU: kDLCPU, - DeviceType.CUDA: _GPU_DEVICE_TYPE, - DeviceType.GPU: _GPU_DEVICE_TYPE, - } - class c_DLDataType(ctypes.Structure): def __init__(self, dtype: DType): diff --git a/fastsafetensors/frameworks/_torch.py b/fastsafetensors/frameworks/_torch.py index 1487153..affa214 100644 --- a/fastsafetensors/frameworks/_torch.py +++ b/fastsafetensors/frameworks/_torch.py @@ -186,9 +186,18 @@ def copy_tensor(self, dst: TorchTensor, src: TorchTensor): dst.real_tensor.copy_(src.real_tensor) def get_cuda_ver(self) -> str: + """Get GPU runtime version with platform indicator. + + Returns a string like 'hip-5.7.0' for ROCm or 'cuda-12.1' for CUDA, + or 'none' if no GPU is available. This allows code to distinguish + between different GPU platforms without using torch directly. + """ if torch.cuda.is_available(): - return str(torch.version.cuda) - return "0.0" + # Check if this is ROCm/HIP build + if hasattr(torch.version, "hip") and torch.version.hip is not None: + return f"hip-{torch.version.hip}" + return f"cuda-{torch.version.cuda}" + return "none" def get_device_ptr_align(self) -> int: CUDA_PTR_ALIGN: int = 16 diff --git a/fastsafetensors/loader.py b/fastsafetensors/loader.py index 60959fa..9e7e526 100644 --- a/fastsafetensors/loader.py +++ b/fastsafetensors/loader.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, OrderedDict, Tuple, Union from . import cpp as fstcpp -from .common import SafeTensorsMetadata, TensorFrame, get_device_numa_node +from .common import SafeTensorsMetadata, TensorFrame, get_device_numa_node, is_gpu_found from .file_buffer import FilesBufferOnDevice from .frameworks import TensorBase, get_framework_op from .st_types import DeviceType, DType @@ -69,8 +69,10 @@ def __init__( gl_set_numa = True fstcpp.set_debug_log(debug_log) device_is_not_cpu = self.device.type != DeviceType.CPU - if device_is_not_cpu and not fstcpp.is_cuda_found(): - raise Exception("[FAIL] libcudart.so does not exist") + if device_is_not_cpu and not is_gpu_found(): + raise Exception( + "[FAIL] GPU runtime library (libcudart.so or libamdhip64.so) does not exist" + ) if not fstcpp.is_cufile_found() and not nogds: warnings.warn( "libcufile.so does not exist but nogds is False. use nogds=True", diff --git a/setup.py b/setup.py index adecf4e..dbc7e6e 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ def detect_platform(): for path in ["/opt/rocm", "/opt/rocm-*"]: if "*" in path: import glob + matches = sorted(glob.glob(path), reverse=True) if matches: rocm_path = matches[0] @@ -45,14 +46,14 @@ def detect_platform(): rocm_version = f.read().strip() else: # Try to extract version from path - match = re.search(r'rocm[-/](\d+\.\d+(?:\.\d+)?)', rocm_path) + match = re.search(r"rocm[-/](\d+\.\d+(?:\.\d+)?)", rocm_path) if match: rocm_version = match.group(1) print(f"Detected ROCm platform at {rocm_path}") if rocm_version: print(f"ROCm version: {rocm_version}") - return ('rocm', rocm_version, rocm_path) + return ("rocm", rocm_version, rocm_path) # Check for CUDA cuda_home = os.environ.get("CUDA_HOME") or os.environ.get("CUDA_PATH") @@ -64,11 +65,11 @@ def detect_platform(): if cuda_home and os.path.exists(cuda_home): print(f"Detected CUDA platform at {cuda_home}") - return ('cuda', None, None) + return ("cuda", None, None) # Default to CUDA if nothing detected print("No GPU platform detected, defaulting to CUDA") - return ('cuda', None, None) + return ("cuda", None, None) def hipify_source_files(rocm_path): @@ -110,7 +111,7 @@ def hipify_source_files(rocm_path): hipified_files = [] for source_path, result in hipify_result.items(): - if hasattr(result, 'hipified_path') and result.hipified_path: + if hasattr(result, "hipified_path") and result.hipified_path: print(f"Successfully hipified: {source_path} -> {result.hipified_path}") hipified_files.append(result.hipified_path) @@ -126,8 +127,9 @@ def hipify_source_files(rocm_path): return hipified_files - -def MyExtension(name, sources, mod_name, platform_type, rocm_path=None, *args, **kwargs): +def MyExtension( + name, sources, mod_name, platform_type, rocm_path=None, *args, **kwargs +): import pybind11 pybind11_path = os.path.dirname(pybind11.__file__) @@ -143,7 +145,7 @@ def MyExtension(name, sources, mod_name, platform_type, rocm_path=None, *args, * kwargs["extra_compile_args"] = ["-fvisibility=hidden", "-std=c++17"] # Platform-specific configuration - if platform_type == 'rocm' and rocm_path: + if platform_type == "rocm" and rocm_path: # ROCm/HIP configuration kwargs["define_macros"].append(("__HIP_PLATFORM_AMD__", "1")) kwargs["libraries"].append("amdhip64") @@ -168,7 +170,7 @@ def run(self): self.rocm_path = rocm_path # Configure build based on platform - if platform_type == 'rocm' and rocm_path: + if platform_type == "rocm" and rocm_path: print("=" * 60) print("Building for AMD ROCm platform") if rocm_version: @@ -182,9 +184,14 @@ def run(self): for ext in self.extensions: new_sources = [] for src in ext.sources: - if 'fastsafetensors/cpp/ext.cpp' in src: + if "fastsafetensors/cpp/ext.cpp" in src: # torch.utils.hipify creates files in hip/ subdirectory - new_sources.append(src.replace('fastsafetensors/cpp/ext.cpp', 'fastsafetensors/cpp/hip/ext.cpp')) + new_sources.append( + src.replace( + "fastsafetensors/cpp/ext.cpp", + "fastsafetensors/cpp/hip/ext.cpp", + ) + ) else: new_sources.append(src) ext.sources = new_sources @@ -234,6 +241,6 @@ def run(self): ) ], cmdclass={ - 'build_ext': CustomBuildExt, + "build_ext": CustomBuildExt, }, ) diff --git a/tests/conftest.py b/tests/conftest.py index 5960d3c..ba054d0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ from fastsafetensors import SingleGroup from fastsafetensors import cpp as fstcpp +from fastsafetensors.common import is_gpu_found from fastsafetensors.cpp import load_nvidia_functions from fastsafetensors.frameworks import FrameworkOpBase, get_framework_op from fastsafetensors.st_types import Device @@ -14,6 +15,7 @@ TESTS_DIR = os.path.dirname(__file__) sys.path.insert(0, TESTS_DIR) from platform_utils import get_platform_info, is_rocm_platform + REPO_ROOT = os.path.dirname(os.path.dirname(TESTS_DIR)) DATA_DIR = os.path.join(REPO_ROOT, ".testdata") TF_DIR = os.path.join(DATA_DIR, "transformers_cache") @@ -81,7 +83,7 @@ def pg(): @pytest.fixture(scope="session", autouse=True) def dev_init() -> None: - if fstcpp.is_cuda_found(): + if is_gpu_found(): dev_str = "cuda:0" if FRAMEWORK.get_name() == "pytorch" else "gpu:0" else: dev_str = "cpu" diff --git a/tests/platform_utils.py b/tests/platform_utils.py index a7c8c31..e0b4498 100644 --- a/tests/platform_utils.py +++ b/tests/platform_utils.py @@ -1,5 +1,5 @@ -# Copyright 2024 IBM Inc. All rights reserved # SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 IBM Inc. All rights reserved """Utilities for platform detection and conditional test execution.""" @@ -7,15 +7,16 @@ def is_rocm_platform(): - """Detect if running on ROCm/AMD platform.""" + """Detect if running on ROCm/AMD platform. + + Uses the C++ extension's is_hip_found() to avoid framework-specific calls. + """ try: - import torch - if torch.cuda.is_available(): - if hasattr(torch.version, 'hip') and torch.version.hip is not None: - return True + from fastsafetensors import cpp as fstcpp + + return fstcpp.is_hip_found() except: - pass - return False + return False def is_cuda_platform(): @@ -25,26 +26,28 @@ def is_cuda_platform(): # List of tests that are expected to fail on ROCm (based on TEST_RESULTS.md) ROCM_EXPECTED_FAILURES = { - 'test_GdsFileCopier', # GDS not available on AMD + "test_GdsFileCopier", # GDS not available on AMD } # List of tests with memory leak detection issues on ROCm (non-critical) ROCM_MEMORY_LEAK_TESTS = { - 'test_SafeTensorsFileLoader', - 'test_SafeTensorsFileLoaderNoGds', - 'test_fastsafe_open', - 'test_int8', - 'test_float8_e5m2', - 'test_float8_e4m3fn', - 'test_float8_e4m3fn_to_int8', - 'test_cpp_metrics', + "test_SafeTensorsFileLoader", + "test_SafeTensorsFileLoaderNoGds", + "test_fastsafe_open", + "test_int8", + "test_float8_e5m2", + "test_float8_e4m3fn", + "test_float8_e4m3fn_to_int8", + "test_cpp_metrics", } def skip_if_rocm_expected_failure(test_name): """Skip test if it's an expected failure on ROCm.""" if is_rocm_platform() and test_name in ROCM_EXPECTED_FAILURES: - pytest.skip(f"Test '{test_name}' is expected to fail on ROCm (GDS not supported)") + pytest.skip( + f"Test '{test_name}' is expected to fail on ROCm (GDS not supported)" + ) def xfail_if_rocm_memory_leak(test_name): @@ -52,29 +55,57 @@ def xfail_if_rocm_memory_leak(test_name): if is_rocm_platform() and test_name in ROCM_MEMORY_LEAK_TESTS: return pytest.mark.xfail( reason=f"Test '{test_name}' has memory leak detection issues on ROCm (non-critical)", - strict=False + strict=False, ) return lambda func: func def get_platform_info(): - """Get platform information for debugging.""" + """Get platform information for debugging. + + Uses framework's get_cuda_ver() to avoid direct torch calls where possible. + """ info = { - 'is_rocm': is_rocm_platform(), - 'is_cuda': is_cuda_platform(), + "is_rocm": is_rocm_platform(), + "is_cuda": is_cuda_platform(), } try: - import torch - if torch.cuda.is_available(): - info['torch_version'] = torch.__version__ - if is_rocm_platform(): - info['hip_version'] = torch.version.hip - info['rocm_version'] = torch.version.hip - else: - info['cuda_version'] = torch.version.cuda - info['device_count'] = torch.cuda.device_count() - info['device_name'] = torch.cuda.get_device_name(0) if torch.cuda.device_count() > 0 else None + from fastsafetensors import cpp as fstcpp + from fastsafetensors.common import is_gpu_found + + if is_gpu_found(): + # Get version info from framework + try: + from fastsafetensors.frameworks import get_framework_op + + framework = get_framework_op("pytorch") + gpu_ver = framework.get_cuda_ver() + info["gpu_version"] = gpu_ver + + # Parse the version to get specific info + if gpu_ver.startswith("hip-"): + info["hip_version"] = gpu_ver[4:] # Remove 'hip-' prefix + info["rocm_version"] = gpu_ver[4:] + elif gpu_ver.startswith("cuda-"): + info["cuda_version"] = gpu_ver[5:] # Remove 'cuda-' prefix + except: + pass + + # Get device count and name (still needs torch for this) + try: + import torch + + if torch.cuda.is_available(): + info["torch_version"] = torch.__version__ + info["device_count"] = torch.cuda.device_count() + info["device_name"] = ( + torch.cuda.get_device_name(0) + if torch.cuda.device_count() > 0 + else None + ) + except: + pass except: pass diff --git a/tests/test_fastsafetensors.py b/tests/test_fastsafetensors.py index 1606571..118e2ca 100644 --- a/tests/test_fastsafetensors.py +++ b/tests/test_fastsafetensors.py @@ -11,7 +11,7 @@ from fastsafetensors import SafeTensorsFileLoader, SafeTensorsMetadata, SingleGroup from fastsafetensors import cpp as fstcpp from fastsafetensors import fastsafe_open -from fastsafetensors.common import get_device_numa_node +from fastsafetensors.common import get_device_numa_node, is_gpu_found from fastsafetensors.copier.gds import GdsFileCopier from fastsafetensors.copier.nogds import NoGdsFileCopier from fastsafetensors.dlpack import from_cuda_buffer @@ -63,7 +63,7 @@ def save_safetensors_file( def get_and_check_device(framework: FrameworkOpBase): - dev_is_gpu = fstcpp.is_cuda_found() + dev_is_gpu = is_gpu_found() device = "cpu" if dev_is_gpu: if framework.get_name() == "pytorch": @@ -110,18 +110,29 @@ def test_framework(fstcpp_log, framework) -> None: framework.is_equal(t, [float(0.0)]) with pytest.raises(Exception): framework.get_process_group(int(0)) + # Test that get_cuda_ver() returns a string with platform prefix + cuda_ver = framework.get_cuda_ver() + assert isinstance(cuda_ver, str) + # Should be "hip-X.Y.Z", "cuda-X.Y", or "none" + assert ( + cuda_ver.startswith("hip-") + or cuda_ver.startswith("cuda-") + or cuda_ver == "none" + ) + + # Verify it matches what torch reports if framework.get_name() == "pytorch": import torch - cuda_ver = str(torch.version.cuda) if torch.cuda.is_available() else "0.0" - elif framework.get_name() == "paddle": - import paddle - - if paddle.device.is_compiled_with_cuda(): - cuda_ver = str(paddle.version.cuda()) + if torch.cuda.is_available(): + if hasattr(torch.version, "hip") and torch.version.hip: + assert cuda_ver.startswith("hip-") + assert str(torch.version.hip) in cuda_ver + else: + assert cuda_ver.startswith("cuda-") + assert str(torch.version.cuda) in cuda_ver else: - cuda_ver = "0.0" - assert framework.get_cuda_ver() == cuda_ver + assert cuda_ver == "none" def test_get_framework_fail(fstcpp_log) -> None: @@ -233,10 +244,10 @@ def test_close_gds(fstcpp_log) -> None: def test_get_device_pci_bus(fstcpp_log) -> None: bus = fstcpp.get_device_pci_bus(0) - if not fstcpp.is_cuda_found(): + if not is_gpu_found(): assert bus == "" else: - print(f"bus for cuda:0: {bus}") + print(f"bus for gpu:0: {bus}") assert len(bus) > 0 diff --git a/tests/test_multi.py b/tests/test_multi.py index b80b2f9..12b95cf 100644 --- a/tests/test_multi.py +++ b/tests/test_multi.py @@ -5,6 +5,7 @@ from fastsafetensors import SafeTensorsFileLoader from fastsafetensors import cpp as fstcpp +from fastsafetensors.common import is_gpu_found def test_shuffle(fstcpp_log, input_files, pg, framework): @@ -14,13 +15,13 @@ def test_shuffle(fstcpp_log, input_files, pg, framework): rank = pg.rank() world_size = pg.size() - device = "cuda:0" if fstcpp.is_cuda_found() else "cpu" + device = "cuda:0" if is_gpu_found() else "cpu" elif framework.get_name() == "paddle": from safetensors.paddle import load_file rank = pg.process_group.rank() world_size = pg.process_group.size() - device = "gpu:0" if fstcpp.is_cuda_found() else "cpu" + device = "gpu:0" if is_gpu_found() else "cpu" else: raise Exception(f"Unknown framework: {framework.get_name()}") loader = SafeTensorsFileLoader( From f7e617d4d5747e3dc8b92bb8f63fb268d6405e58 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 14:08:55 +0000 Subject: [PATCH 06/48] remove torch dependencies Signed-off-by: tjtanaa --- setup.py | 95 +++++++++++++++++++++++++++++++---------------- tests/conftest.py | 3 +- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/setup.py b/setup.py index dbc7e6e..b513c58 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import os import re import shutil +import subprocess from pathlib import Path from setuptools import Extension, setup @@ -74,7 +75,7 @@ def detect_platform(): def hipify_source_files(rocm_path): """ - Automatically hipify CUDA source files to HIP using torch.utils.hipify. + Automatically hipify CUDA source files to HIP using hipify-perl from ROCm. The cuda_compat.h header handles what hipify doesn't convert. Args: @@ -83,46 +84,74 @@ def hipify_source_files(rocm_path): Returns: list: Paths to hipified source files """ - from torch.utils.hipify.hipify_python import hipify - cpp_dir = Path("fastsafetensors/cpp").resolve() + hip_dir = cpp_dir / "hip" - # Prepare source files for hipification - extra_files = [ - str(cpp_dir / "ext.cpp"), - str(cpp_dir / "ext.hpp"), - ] + # Create hip/ subdirectory if it doesn't exist + hip_dir.mkdir(exist_ok=True) + + # Find hipify-perl in ROCm installation + hipify_perl = os.path.join(rocm_path, "bin", "hipify-perl") + if not os.path.exists(hipify_perl): + raise RuntimeError( + f"hipify-perl not found at {hipify_perl}. " + f"Please ensure ROCm is properly installed at {rocm_path}" + ) - print(f"Hipifying files using torch.utils.hipify:") - for f in extra_files: - print(f" - {f}") - - # Use torch's hipify - similar to vLLM's approach - hipify_result = hipify( - project_directory=str(cpp_dir.parent), - output_directory=str(cpp_dir), - header_include_dirs=[], - includes=[f"{cpp_dir}/*"], - extra_files=extra_files, - show_detailed=False, - is_pytorch_extension=False, - hipify_extra_files_only=True, - ) + # Files to hipify + source_files = [ + ("ext.cpp", "ext.cpp"), + ("ext.hpp", "ext.hpp"), + ] + print(f"Hipifying files using hipify-perl from {hipify_perl}:") hipified_files = [] - for source_path, result in hipify_result.items(): - if hasattr(result, "hipified_path") and result.hipified_path: - print(f"Successfully hipified: {source_path} -> {result.hipified_path}") - hipified_files.append(result.hipified_path) + + for src_name, dst_name in source_files: + src_path = cpp_dir / src_name + dst_path = hip_dir / dst_name + + print(f" - {src_path} -> {dst_path}") + + try: + # Run hipify-perl: hipify-perl input.cpp -o output.cpp + result = subprocess.run( + [hipify_perl, str(src_path), "-o", str(dst_path)], + check=True, + capture_output=True, + text=True, + ) + print(f" Successfully hipified: {src_name}") + hipified_files.append(str(dst_path)) + + # Print any warnings from hipify-perl + if result.stderr: + print(f" hipify-perl output: {result.stderr.strip()}") + + # Post-process: Replace cuda_compat.h with hip_compat.h + # hipify-perl doesn't convert custom header names + with open(dst_path, "r") as f: + content = f.read() + content = content.replace( + '#include "cuda_compat.h"', '#include "hip_compat.h"' + ) + with open(dst_path, "w") as f: + f.write(content) + print(f" Post-processed: cuda_compat.h -> hip_compat.h") + + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"Failed to hipify {src_path}:\n" + f"stdout: {e.stdout}\n" + f"stderr: {e.stderr}" + ) from e # Copy cuda_compat.h to hip directory as hip_compat.h # (hipify converts the include statement from cuda_compat.h to hip_compat.h) - hip_dir = cpp_dir / "hip" - if hip_dir.exists(): - cuda_compat = cpp_dir / "cuda_compat.h" - hip_compat = hip_dir / "hip_compat.h" - shutil.copy2(cuda_compat, hip_compat) - print(f"Copied {cuda_compat} -> {hip_compat}") + cuda_compat = cpp_dir / "cuda_compat.h" + hip_compat = hip_dir / "hip_compat.h" + shutil.copy2(cuda_compat, hip_compat) + print(f"Copied {cuda_compat} -> {hip_compat}") return hipified_files diff --git a/tests/conftest.py b/tests/conftest.py index ba054d0..af4d27f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,8 +13,7 @@ # Add tests directory to path to import platform_utils TESTS_DIR = os.path.dirname(__file__) -sys.path.insert(0, TESTS_DIR) -from platform_utils import get_platform_info, is_rocm_platform +from platform_utils import get_platform_info REPO_ROOT = os.path.dirname(os.path.dirname(TESTS_DIR)) DATA_DIR = os.path.join(REPO_ROOT, ".testdata") From 72eb7854a076e558c49c8e6fb7e3d575f4ff7895 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:12:37 +0000 Subject: [PATCH 07/48] handle when cuda and rocm not found Signed-off-by: tjtanaa --- fastsafetensors/copier/gds.py | 28 ++++++++++++++++++++-------- fastsafetensors/cpp/cuda_compat.h | 2 -- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/fastsafetensors/copier/gds.py b/fastsafetensors/copier/gds.py index 5f2ec3a..dc24f1f 100644 --- a/fastsafetensors/copier/gds.py +++ b/fastsafetensors/copier/gds.py @@ -28,15 +28,27 @@ def __init__( self.copy_reqs: Dict[int, int] = {} self.aligned_length = 0 cuda_ver = framework.get_cuda_ver() - if cuda_ver and cuda_ver != "None": - cudavers = list(map(int, cuda_ver.split("."))) - # CUDA 12.2 (GDS version 1.7) introduces support for non O_DIRECT file descriptors - # Compatible with CUDA 11.x - self.o_direct = not ( - cudavers[0] > 12 or (cudavers[0] == 12 and cudavers[1] >= 2) - ) + if cuda_ver and cuda_ver != "none": + # Parse version string (e.g., "cuda-12.1" or "hip-5.7.0") + # Extract the numeric part after the platform prefix + ver_parts = cuda_ver.split("-", 1) + if len(ver_parts) == 2: + cudavers = list(map(int, ver_parts[1].split("."))) + # CUDA 12.2 (GDS version 1.7) introduces support for non O_DIRECT file descriptors + # Compatible with CUDA 11.x + # Only applies to CUDA platform (not ROCm/HIP) + if ver_parts[0] == "cuda": + self.o_direct = not ( + cudavers[0] > 12 or (cudavers[0] == 12 and cudavers[1] >= 2) + ) + else: + # ROCm/HIP platform, use O_DIRECT + self.o_direct = True + else: + # Fallback if format is unexpected + self.o_direct = True else: - # ROCm or non-CUDA platform, use O_DIRECT + # No GPU platform detected, use O_DIRECT self.o_direct = True def set_o_direct(self, enable: bool): diff --git a/fastsafetensors/cpp/cuda_compat.h b/fastsafetensors/cpp/cuda_compat.h index f430ec3..021e7f4 100644 --- a/fastsafetensors/cpp/cuda_compat.h +++ b/fastsafetensors/cpp/cuda_compat.h @@ -1,7 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 /* - * Copyright 2024 IBM Inc. All rights reserved - * * CUDA/HIP compatibility layer for fastsafetensors * Minimal compatibility header - only defines what hipify-perl doesn't handle */ From 6ddba67ea8e0e6a19392495f6e4905e0e35683d6 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:23:15 +0000 Subject: [PATCH 08/48] fix paddle paddle Signed-off-by: tjtanaa --- fastsafetensors/frameworks/_paddle.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fastsafetensors/frameworks/_paddle.py b/fastsafetensors/frameworks/_paddle.py index 13f5eec..7592d31 100644 --- a/fastsafetensors/frameworks/_paddle.py +++ b/fastsafetensors/frameworks/_paddle.py @@ -214,11 +214,18 @@ def copy_tensor(self, dst: PaddleTensor, src: PaddleTensor) -> None: dst.device = src.device def get_cuda_ver(self) -> str: - return ( - str(paddle.version.cuda()) - if paddle.device.is_compiled_with_cuda() - else "0.0" - ) + """Get GPU runtime version with platform indicator. + + Returns a string like 'hip-5.7.0' for ROCm or 'cuda-12.1' for CUDA, + or 'none' if no GPU is available. This allows code to distinguish + between different GPU platforms without using paddle directly. + """ + if paddle.device.is_compiled_with_cuda(): + # Check if this is ROCm/HIP build + if paddle.device.is_compiled_with_rocm(): + return f"hip-{paddle.version.cuda()}" + return f"cuda-{paddle.version.cuda()}" + return "none" def get_device_ptr_align(self) -> int: CUDA_PTR_ALIGN: int = 16 From 8714185372b2c7cfbacb48d7903581a185eadcc3 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:40:32 +0000 Subject: [PATCH 09/48] setup rocm wheel ci build Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 234 +++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 .github/workflows/build-rocm-wheels.yaml diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml new file mode 100644 index 0000000..3ff78b7 --- /dev/null +++ b/.github/workflows/build-rocm-wheels.yaml @@ -0,0 +1,234 @@ +name: Build ROCm wheels + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - 'fastsafetensors/cpp/**' + - 'setup.py' + - '.github/workflows/build-rocm-wheels.yaml' + pull_request: + branches: [main] + paths: + - 'fastsafetensors/cpp/**' + - 'setup.py' + - '.github/workflows/build-rocm-wheels.yaml' + +permissions: + contents: read + +jobs: + build-rocm-wheels: + name: Build ROCm wheel - Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + container: + image: rocm/dev-ubuntu-22.04:7.0 + options: --user root + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install system dependencies and hipify-perl + run: | + apt-get update + apt-get install -y \ + wget \ + build-essential \ + libnuma-dev \ + gcc \ + g++ \ + make \ + git \ + curl \ + ca-certificates \ + hipify-perl \ + libssl-dev \ + zlib1g-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + libncursesw5-dev \ + xz-utils \ + tk-dev \ + libxml2-dev \ + libxmlsec1-dev \ + libffi-dev \ + liblzma-dev \ + software-properties-common + + # Verify hipify-perl is available + which hipify-perl || echo "Warning: hipify-perl not found" + + - name: Install Python ${{ matrix.python-version }} + run: | + # Install Python from deadsnakes PPA for Ubuntu 22.04 + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update + + # Install specific Python version and dev packages + PY_VER="${{ matrix.python-version }}" + apt-get install -y \ + python${PY_VER} \ + python${PY_VER}-dev \ + python${PY_VER}-distutils || true + + # Install pip for this Python version + curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER} + + # Create symlink for easier access + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 + update-alternatives --set python3 /usr/bin/python${PY_VER} + + # Verify installation + python3 --version + python3 -m pip --version + + - name: Install Python build dependencies + run: | + python3 -m pip install --upgrade pip setuptools wheel + python3 -m pip install build setuptools_scm pybind11 numpy + + - name: Set ROCm environment variables + run: | + echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV + echo "HIP_PATH=/opt/rocm/hip" >> $GITHUB_ENV + echo "/opt/rocm/bin" >> $GITHUB_PATH + echo "/opt/rocm/hip/bin" >> $GITHUB_PATH + + # Verify ROCm installation + ls -la /opt/rocm/ || echo "Warning: /opt/rocm not found" + hipify-perl --version || echo "Warning: hipify-perl not working" + + - name: Build wheel for ROCm + run: | + # The setup.py should detect ROCm and use hipify-perl automatically + python3 -m pip wheel . -w wheelhouse/ --no-deps -v + env: + ROCM_PATH: /opt/rocm + HIP_PATH: /opt/rocm/hip + + - name: List built wheels + run: | + ls -lah wheelhouse/ + + - name: Rename wheel to include rocm tag + run: | + cd wheelhouse + for wheel in *.whl; do + if [ -f "$wheel" ]; then + # Rename to include rocm tag before platform + # e.g., fastsafetensors-X.Y.Z-cp39-cp39-linux_x86_64.whl + # becomes fastsafetensors-X.Y.Z-cp39-cp39-rocm_linux_x86_64.whl + NEW_NAME=$(echo "$wheel" | sed "s/-linux_/-rocm_linux_/") + + if [ "$wheel" != "$NEW_NAME" ]; then + mv "$wheel" "$NEW_NAME" + echo "Renamed: $wheel -> $NEW_NAME" + fi + fi + done + ls -lah + + - name: Upload wheel artifact + uses: actions/upload-artifact@v4 + with: + name: rocm-wheel-py${{ matrix.python-version }} + path: wheelhouse/*.whl + if-no-files-found: error + + test-rocm-wheels: + name: Test ROCm wheel - Python ${{ matrix.python-version }} + needs: build-rocm-wheels + runs-on: ubuntu-latest + container: + image: rocm/dev-ubuntu-22.04:7.0 + options: --user root + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Python ${{ matrix.python-version }} + run: | + apt-get update + apt-get install -y software-properties-common + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update + + PY_VER="${{ matrix.python-version }}" + apt-get install -y \ + python${PY_VER} \ + python${PY_VER}-dev \ + python${PY_VER}-distutils || true + + curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER} + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 + update-alternatives --set python3 /usr/bin/python${PY_VER} + + python3 --version + + - name: Download wheel + uses: actions/download-artifact@v4 + with: + name: rocm-wheel-py${{ matrix.python-version }} + path: wheelhouse/ + + - name: Install wheel and test dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install wheelhouse/*.whl + + # Install test dependencies + python3 -m pip install pytest safetensors transformers numpy + + # Install PyTorch with ROCm support for testing + python3 -m pip install torch --index-url https://download.pytorch.org/whl/rocm6.2 || \ + python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu + + - name: Run basic import test + run: | + python3 -c "import fastsafetensors; print('Import successful')" + python3 -c "from fastsafetensors import SafeTensorsFileLoader; print('SafeTensorsFileLoader imported')" + python3 -c "from fastsafetensors.frameworks import get_framework_op; fw = get_framework_op('pytorch'); print(f'PyTorch framework: {fw.get_name()}')" + python3 -c "from fastsafetensors.frameworks import get_framework_op; fw = get_framework_op('pytorch'); ver = fw.get_cuda_ver(); print(f'CUDA/ROCm version: {ver}')" + + - name: Run basic tests + run: | + cd tests + export TEST_FASTSAFETENSORS_FRAMEWORK=pytorch + python3 -m pytest -xvs test_fastsafetensors.py::test_device + python3 -m pytest -xvs test_fastsafetensors.py::test_framework + + collect-wheels: + name: Collect all ROCm wheels + needs: test-rocm-wheels + runs-on: ubuntu-latest + + steps: + - name: Download all wheel artifacts + uses: actions/download-artifact@v4 + with: + path: all-wheels/ + pattern: rocm-wheel-* + merge-multiple: true + + - name: List all wheels + run: | + echo "Built ROCm wheels:" + ls -lah all-wheels/ + + - name: Upload combined artifact + uses: actions/upload-artifact@v4 + with: + name: rocm-wheels-all + path: all-wheels/*.whl From 5fb3a142f97e56f73c3770a6178bcc1b736d8d49 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:42:06 +0000 Subject: [PATCH 10/48] manual trigger rocm workflow Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 3ff78b7..5703d48 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -2,18 +2,6 @@ name: Build ROCm wheels on: workflow_dispatch: - push: - branches: [main] - paths: - - 'fastsafetensors/cpp/**' - - 'setup.py' - - '.github/workflows/build-rocm-wheels.yaml' - pull_request: - branches: [main] - paths: - - 'fastsafetensors/cpp/**' - - 'setup.py' - - '.github/workflows/build-rocm-wheels.yaml' permissions: contents: read From 5e2e4afa76df18d7a4fe8231b8771cf70afa44fe Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:49:37 +0000 Subject: [PATCH 11/48] remove system package steps Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 34 ------------------------ 1 file changed, 34 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 5703d48..fff2f56 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -3,9 +3,6 @@ name: Build ROCm wheels on: workflow_dispatch: -permissions: - contents: read - jobs: build-rocm-wheels: name: Build ROCm wheel - Python ${{ matrix.python-version }} @@ -22,37 +19,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install system dependencies and hipify-perl - run: | - apt-get update - apt-get install -y \ - wget \ - build-essential \ - libnuma-dev \ - gcc \ - g++ \ - make \ - git \ - curl \ - ca-certificates \ - hipify-perl \ - libssl-dev \ - zlib1g-dev \ - libbz2-dev \ - libreadline-dev \ - libsqlite3-dev \ - libncursesw5-dev \ - xz-utils \ - tk-dev \ - libxml2-dev \ - libxmlsec1-dev \ - libffi-dev \ - liblzma-dev \ - software-properties-common - - # Verify hipify-perl is available - which hipify-perl || echo "Warning: hipify-perl not found" - - name: Install Python ${{ matrix.python-version }} run: | # Install Python from deadsnakes PPA for Ubuntu 22.04 From 75530b5d28b636ec55ac08889e5e4ae098eddb22 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 19:55:22 +0000 Subject: [PATCH 12/48] install system dependencies Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index fff2f56..94d5a99 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -19,6 +19,21 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install system dependencies + run: | + apt-get update + apt-get install -y \ + software-properties-common \ + wget \ + build-essential \ + libnuma-dev \ + gcc \ + g++ \ + make \ + git \ + curl \ + ca-certificates + - name: Install Python ${{ matrix.python-version }} run: | # Install Python from deadsnakes PPA for Ubuntu 22.04 From 6ad6bb2dd7597666be8cd73a3eef7be2a72e8baf Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 20:04:51 +0000 Subject: [PATCH 13/48] upgrade ubuntu version, skip tests Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 77 +++--------------------- 1 file changed, 9 insertions(+), 68 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 94d5a99..ad043b8 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -21,6 +21,10 @@ jobs: - name: Install system dependencies run: | + # Prevent interactive prompts during package installation + export DEBIAN_FRONTEND=noninteractive + export TZ=Etc/UTC + apt-get update apt-get install -y \ software-properties-common \ @@ -36,6 +40,10 @@ jobs: - name: Install Python ${{ matrix.python-version }} run: | + # Prevent interactive prompts during package installation + export DEBIAN_FRONTEND=noninteractive + export TZ=Etc/UTC + # Install Python from deadsnakes PPA for Ubuntu 22.04 add-apt-repository -y ppa:deadsnakes/ppa apt-get update @@ -111,76 +119,9 @@ jobs: path: wheelhouse/*.whl if-no-files-found: error - test-rocm-wheels: - name: Test ROCm wheel - Python ${{ matrix.python-version }} - needs: build-rocm-wheels - runs-on: ubuntu-latest - container: - image: rocm/dev-ubuntu-22.04:7.0 - options: --user root - strategy: - fail-fast: false - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Python ${{ matrix.python-version }} - run: | - apt-get update - apt-get install -y software-properties-common - add-apt-repository -y ppa:deadsnakes/ppa - apt-get update - - PY_VER="${{ matrix.python-version }}" - apt-get install -y \ - python${PY_VER} \ - python${PY_VER}-dev \ - python${PY_VER}-distutils || true - - curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER} - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 - update-alternatives --set python3 /usr/bin/python${PY_VER} - - python3 --version - - - name: Download wheel - uses: actions/download-artifact@v4 - with: - name: rocm-wheel-py${{ matrix.python-version }} - path: wheelhouse/ - - - name: Install wheel and test dependencies - run: | - python3 -m pip install --upgrade pip - python3 -m pip install wheelhouse/*.whl - - # Install test dependencies - python3 -m pip install pytest safetensors transformers numpy - - # Install PyTorch with ROCm support for testing - python3 -m pip install torch --index-url https://download.pytorch.org/whl/rocm6.2 || \ - python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu - - - name: Run basic import test - run: | - python3 -c "import fastsafetensors; print('Import successful')" - python3 -c "from fastsafetensors import SafeTensorsFileLoader; print('SafeTensorsFileLoader imported')" - python3 -c "from fastsafetensors.frameworks import get_framework_op; fw = get_framework_op('pytorch'); print(f'PyTorch framework: {fw.get_name()}')" - python3 -c "from fastsafetensors.frameworks import get_framework_op; fw = get_framework_op('pytorch'); ver = fw.get_cuda_ver(); print(f'CUDA/ROCm version: {ver}')" - - - name: Run basic tests - run: | - cd tests - export TEST_FASTSAFETENSORS_FRAMEWORK=pytorch - python3 -m pytest -xvs test_fastsafetensors.py::test_device - python3 -m pytest -xvs test_fastsafetensors.py::test_framework - collect-wheels: name: Collect all ROCm wheels - needs: test-rocm-wheels + needs: build-rocm-wheels runs-on: ubuntu-latest steps: From ab00395e20afc52170631f119a6724ea514a8b3e Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 20:07:24 +0000 Subject: [PATCH 14/48] upgrade ubuntu version, skip tests Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index ad043b8..54865c9 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -8,7 +8,7 @@ jobs: name: Build ROCm wheel - Python ${{ matrix.python-version }} runs-on: ubuntu-latest container: - image: rocm/dev-ubuntu-22.04:7.0 + image: rocm/dev-ubuntu-24.04:7.0 options: --user root strategy: fail-fast: false @@ -44,7 +44,7 @@ jobs: export DEBIAN_FRONTEND=noninteractive export TZ=Etc/UTC - # Install Python from deadsnakes PPA for Ubuntu 22.04 + # Install Python from deadsnakes PPA for Ubuntu 24.04 add-apt-repository -y ppa:deadsnakes/ppa apt-get update From 9a11ce3f38d8616b1c2955c9fdff197a4e4b0c94 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 20:55:46 +0000 Subject: [PATCH 15/48] install from python from offical source Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 53 +++++++++++++++++++----- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 54865c9..f50a814 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -44,23 +44,54 @@ jobs: export DEBIAN_FRONTEND=noninteractive export TZ=Etc/UTC - # Install Python from deadsnakes PPA for Ubuntu 24.04 - add-apt-repository -y ppa:deadsnakes/ppa - apt-get update - - # Install specific Python version and dev packages PY_VER="${{ matrix.python-version }}" - apt-get install -y \ - python${PY_VER} \ - python${PY_VER}-dev \ - python${PY_VER}-distutils || true + + # Try to install from Ubuntu's official repositories first + apt-get update + if apt-cache show python${PY_VER} 2>/dev/null; then + echo "Installing Python ${PY_VER} from Ubuntu repositories" + apt-get install -y \ + python${PY_VER} \ + python${PY_VER}-dev \ + python${PY_VER}-venv + else + # If not available in Ubuntu repos, install using pyenv + echo "Python ${PY_VER} not in Ubuntu repos, installing via pyenv from python.org" + + # Install pyenv dependencies + apt-get install -y \ + libssl-dev \ + zlib1g-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + libncursesw5-dev \ + xz-utils \ + tk-dev \ + libxml2-dev \ + libxmlsec1-dev \ + libffi-dev \ + liblzma-dev + + # Install pyenv + export PYENV_ROOT="/root/.pyenv" + curl https://pyenv.run | bash + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" + + # Install Python from official python.org releases + pyenv install ${PY_VER} + pyenv global ${PY_VER} + fi # Install pip for this Python version curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER} # Create symlink for easier access - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 - update-alternatives --set python3 /usr/bin/python${PY_VER} + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 || \ + ln -sf $(which python${PY_VER}) /usr/bin/python3 + + update-alternatives --set python3 /usr/bin/python${PY_VER} 2>/dev/null || true # Verify installation python3 --version From d6c1f4ac73dec215b24e4093ef0eab0fd61c5f5b Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 21:02:25 +0000 Subject: [PATCH 16/48] use venv instead Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 35 ++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index f50a814..67db243 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -84,23 +84,26 @@ jobs: pyenv global ${PY_VER} fi - # Install pip for this Python version - curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER} + # Verify installation + python${PY_VER} --version - # Create symlink for easier access - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1 || \ - ln -sf $(which python${PY_VER}) /usr/bin/python3 + - name: Create virtual environment and install build dependencies + run: | + PY_VER="${{ matrix.python-version }}" - update-alternatives --set python3 /usr/bin/python${PY_VER} 2>/dev/null || true + # Create virtual environment + python${PY_VER} -m venv /opt/venv - # Verify installation - python3 --version - python3 -m pip --version + # Activate venv and install dependencies + . /opt/venv/bin/activate - - name: Install Python build dependencies - run: | - python3 -m pip install --upgrade pip setuptools wheel - python3 -m pip install build setuptools_scm pybind11 numpy + # Upgrade pip and install build tools + python -m pip install --upgrade pip setuptools wheel + python -m pip install build setuptools_scm pybind11 numpy + + # Verify + python --version + pip --version - name: Set ROCm environment variables run: | @@ -108,6 +111,7 @@ jobs: echo "HIP_PATH=/opt/rocm/hip" >> $GITHUB_ENV echo "/opt/rocm/bin" >> $GITHUB_PATH echo "/opt/rocm/hip/bin" >> $GITHUB_PATH + echo "/opt/venv/bin" >> $GITHUB_PATH # Verify ROCm installation ls -la /opt/rocm/ || echo "Warning: /opt/rocm not found" @@ -115,8 +119,11 @@ jobs: - name: Build wheel for ROCm run: | + # Activate venv + . /opt/venv/bin/activate + # The setup.py should detect ROCm and use hipify-perl automatically - python3 -m pip wheel . -w wheelhouse/ --no-deps -v + python -m pip wheel . -w wheelhouse/ --no-deps -v env: ROCM_PATH: /opt/rocm HIP_PATH: /opt/rocm/hip From 5d243830d10e8d275722190139e877de9ff0e070 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 21:18:24 +0000 Subject: [PATCH 17/48] fix other python ci build Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 67db243..a3c85bd 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -46,9 +46,9 @@ jobs: PY_VER="${{ matrix.python-version }}" - # Try to install from Ubuntu's official repositories first + # Check if Python dev package is available in Ubuntu repos apt-get update - if apt-cache show python${PY_VER} 2>/dev/null; then + if apt-cache show python${PY_VER}-dev 2>/dev/null | grep -q "Package: python${PY_VER}-dev"; then echo "Installing Python ${PY_VER} from Ubuntu repositories" apt-get install -y \ python${PY_VER} \ @@ -82,6 +82,11 @@ jobs: # Install Python from official python.org releases pyenv install ${PY_VER} pyenv global ${PY_VER} + + # Create symlink so python${PY_VER} command works + INSTALLED_VERSION=$(ls /root/.pyenv/versions/ | grep "^${PY_VER}") + ln -sf /root/.pyenv/versions/${INSTALLED_VERSION}/bin/python /usr/local/bin/python${PY_VER} + echo "Created symlink: /usr/local/bin/python${PY_VER} -> /root/.pyenv/versions/${INSTALLED_VERSION}/bin/python" fi # Verify installation From 5eba4b5d15bc5fc3a86d8b46fcb81508999adcd7 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 22:13:33 +0000 Subject: [PATCH 18/48] build many linux Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 33 ++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index a3c85bd..a48ce87 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -104,7 +104,7 @@ jobs: # Upgrade pip and install build tools python -m pip install --upgrade pip setuptools wheel - python -m pip install build setuptools_scm pybind11 numpy + python -m pip install build setuptools_scm pybind11 numpy auditwheel # Verify python --version @@ -137,15 +137,38 @@ jobs: run: | ls -lah wheelhouse/ + - name: Repair wheel with auditwheel to create manylinux wheel + run: | + # Activate venv + . /opt/venv/bin/activate + + # Use auditwheel to repair and convert to manylinux wheel + mkdir -p wheelhouse_repaired + for wheel in wheelhouse/*.whl; do + echo "Repairing wheel: $wheel" + auditwheel repair "$wheel" -w wheelhouse_repaired/ || { + echo "auditwheel repair failed, copying original wheel" + cp "$wheel" wheelhouse_repaired/ + } + done + + # Replace original wheelhouse with repaired wheels + rm -rf wheelhouse + mv wheelhouse_repaired wheelhouse + + echo "Repaired wheels:" + ls -lah wheelhouse/ + - name: Rename wheel to include rocm tag run: | cd wheelhouse for wheel in *.whl; do if [ -f "$wheel" ]; then - # Rename to include rocm tag before platform - # e.g., fastsafetensors-X.Y.Z-cp39-cp39-linux_x86_64.whl - # becomes fastsafetensors-X.Y.Z-cp39-cp39-rocm_linux_x86_64.whl - NEW_NAME=$(echo "$wheel" | sed "s/-linux_/-rocm_linux_/") + # Rename to include rocm tag before manylinux/linux platform + # e.g., fastsafetensors-X.Y.Z-cp39-cp39-manylinux_2_27_x86_64.whl + # becomes fastsafetensors-X.Y.Z-cp39-cp39-rocm_manylinux_2_27_x86_64.whl + # Also handles: linux_x86_64 -> rocm_linux_x86_64 + NEW_NAME=$(echo "$wheel" | sed -E "s/-(manylinux|linux)_/-rocm_\1_/") if [ "$wheel" != "$NEW_NAME" ]; then mv "$wheel" "$NEW_NAME" From c543e162152f6d6763c233f2a184bdae9083993b Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 22:24:40 +0000 Subject: [PATCH 19/48] remove rocm_ tag from platform tag Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index a48ce87..80e5ed4 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -159,25 +159,6 @@ jobs: echo "Repaired wheels:" ls -lah wheelhouse/ - - name: Rename wheel to include rocm tag - run: | - cd wheelhouse - for wheel in *.whl; do - if [ -f "$wheel" ]; then - # Rename to include rocm tag before manylinux/linux platform - # e.g., fastsafetensors-X.Y.Z-cp39-cp39-manylinux_2_27_x86_64.whl - # becomes fastsafetensors-X.Y.Z-cp39-cp39-rocm_manylinux_2_27_x86_64.whl - # Also handles: linux_x86_64 -> rocm_linux_x86_64 - NEW_NAME=$(echo "$wheel" | sed -E "s/-(manylinux|linux)_/-rocm_\1_/") - - if [ "$wheel" != "$NEW_NAME" ]; then - mv "$wheel" "$NEW_NAME" - echo "Renamed: $wheel -> $NEW_NAME" - fi - fi - done - ls -lah - - name: Upload wheel artifact uses: actions/upload-artifact@v4 with: From 8ea1956fdbfef0007c614b8396bbaedb671441dd Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 23:30:11 +0000 Subject: [PATCH 20/48] Add automated PyPI index with separate CUDA/ROCm backends - Add script to auto-generate PyPI-compatible index from GitHub releases - Create separate indexes for CUDA and ROCm wheels based on release tags - Add GitHub Actions workflow to deploy indexes to GitHub Pages - Generate landing page with installation instructions - Ignore auto-generated pypi-index directory Indexes will be available at: - ROCm: https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/ - CUDA: https://embeddedllm.github.io/fastsafetensors-rocm/cuda/simple/ Signed-off-by: tjtanaa --- .github/scripts/generate_pypi_index.py | 228 +++++++++++++++++++++++ .github/workflows/deploy-pypi-index.yaml | 53 ++++++ .gitignore | 5 +- 3 files changed, 285 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/generate_pypi_index.py create mode 100644 .github/workflows/deploy-pypi-index.yaml diff --git a/.github/scripts/generate_pypi_index.py b/.github/scripts/generate_pypi_index.py new file mode 100755 index 0000000..eb360d9 --- /dev/null +++ b/.github/scripts/generate_pypi_index.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python3 +""" +Generate PyPI-compatible simple index from GitHub releases. +This script fetches all releases and creates separate indexes for CUDA and ROCm wheels. +""" + +import json +import os +import sys +from pathlib import Path +from urllib.request import urlopen, Request + +def fetch_releases(repo_owner, repo_name): + """Fetch all releases from GitHub API.""" + url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/releases" + headers = { + "Accept": "application/vnd.github.v3+json", + "User-Agent": "PyPI-Index-Generator" + } + + # Add GitHub token if available (for higher rate limits) + token = os.environ.get("GITHUB_TOKEN") + if token: + headers["Authorization"] = f"token {token}" + + request = Request(url, headers=headers) + + try: + with urlopen(request) as response: + return json.loads(response.read().decode()) + except Exception as e: + print(f"Error fetching releases: {e}", file=sys.stderr) + sys.exit(1) + +def categorize_backend(release_tag): + """Determine backend (cuda/rocm) from release tag.""" + tag_lower = release_tag.lower() + + if "rocm" in tag_lower: + return "rocm" + elif "cuda" in tag_lower: + return "cuda" + else: + # Default to cuda for untagged releases + return "cuda" + +def extract_wheels_by_backend(releases): + """Extract wheel files from releases, categorized by backend.""" + wheels_by_backend = { + "cuda": [], + "rocm": [] + } + + for release in releases: + backend = categorize_backend(release.get("tag_name", "")) + + for asset in release.get("assets", []): + name = asset.get("name", "") + if name.endswith(".whl"): + wheels_by_backend[backend].append({ + "name": name, + "url": asset.get("browser_download_url"), + "version": release.get("tag_name"), + }) + + return wheels_by_backend + +def generate_root_index(output_dir, packages): + """Generate the root simple index.""" + html = """ + + + + Simple Index + + +

Simple Index

+""" + + for package in sorted(packages): + html += f' {package}
\n' + + html += """ + +""" + + output_path = output_dir / "index.html" + output_path.write_text(html) + print(f"Generated: {output_path}") + +def generate_package_index(output_dir, package_name, wheels): + """Generate package-specific index with all wheels.""" + html = f""" + + + + Links for {package_name} + + +

Links for {package_name}

+""" + + # Sort wheels by version and Python version + sorted_wheels = sorted(wheels, key=lambda w: (w["name"], w["version"]), reverse=True) + + for wheel in sorted_wheels: + # Extract package name from wheel filename to ensure consistency + wheel_name = wheel["name"] + url = wheel["url"] + html += f' {wheel_name}
\n' + + html += """ + +""" + + package_dir = output_dir / package_name + package_dir.mkdir(parents=True, exist_ok=True) + + output_path = package_dir / "index.html" + output_path.write_text(html) + print(f"Generated: {output_path}") + +def generate_landing_page(base_dir, repo_name): + """Generate a landing page for the PyPI index.""" + html = f""" + + + + {repo_name} - PyPI Index + + + +

{repo_name} - PyPI Index

+

Choose the appropriate index URL based on your GPU backend:

+ +
+

🔥 ROCm (AMD GPUs)

+

For AMD GPUs using ROCm:

+
pip install fastsafetensors --index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
+
+ +
+

💚 CUDA (NVIDIA GPUs)

+

For NVIDIA GPUs using CUDA:

+
pip install fastsafetensors --index-url https://embeddedllm.github.io/{repo_name}/cuda/simple/
+
+ +

Version Specific Installation

+
pip install fastsafetensors==0.1.15 --index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
+ +

In requirements.txt

+
--index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
+fastsafetensors>=0.1.15
+ +
+

Direct access: ROCm Index | CUDA Index

+ + +""" + + output_path = base_dir / "index.html" + output_path.write_text(html) + print(f"Generated landing page: {output_path}") + +def main(): + # Configuration + repo_owner = os.environ.get("GITHUB_REPOSITORY_OWNER", "EmbeddedLLM") + repo_full = os.environ.get("GITHUB_REPOSITORY", "EmbeddedLLM/fastsafetensors-rocm") + repo_name = repo_full.split("/")[-1] + + print(f"Fetching releases from {repo_owner}/{repo_name}...") + releases = fetch_releases(repo_owner, repo_name) + print(f"Found {len(releases)} releases") + + # Extract wheels categorized by backend + wheels_by_backend = extract_wheels_by_backend(releases) + + total_wheels = sum(len(wheels) for wheels in wheels_by_backend.values()) + print(f"Found {total_wheels} total wheel files") + print(f" CUDA: {len(wheels_by_backend['cuda'])} wheels") + print(f" ROCm: {len(wheels_by_backend['rocm'])} wheels") + + if total_wheels == 0: + print("Warning: No wheel files found in any release", file=sys.stderr) + return + + # Generate indexes for each backend + for backend, wheels in wheels_by_backend.items(): + if not wheels: + print(f"Skipping {backend} index (no wheels found)") + continue + + print(f"\nGenerating {backend.upper()} index...") + output_dir = Path(f"pypi-index/{backend}/simple") + output_dir.mkdir(parents=True, exist_ok=True) + + # Group wheels by package name + packages = {} + for wheel in wheels: + # Extract package name from wheel filename (before first dash) + package_name = wheel["name"].split("-")[0] + if package_name not in packages: + packages[package_name] = [] + packages[package_name].append(wheel) + + # Generate indexes + generate_root_index(output_dir, packages.keys()) + + for package_name, package_wheels in packages.items(): + generate_package_index(output_dir, package_name, package_wheels) + + print(f" Generated {backend.upper()} index with {len(packages)} package(s)") + + # Generate landing page + base_dir = Path("pypi-index") + generate_landing_page(base_dir, repo_name) + + print(f"\n✓ Successfully generated indexes for all backends") + print(f" Total wheels: {total_wheels}") + +if __name__ == "__main__": + main() diff --git a/.github/workflows/deploy-pypi-index.yaml b/.github/workflows/deploy-pypi-index.yaml new file mode 100644 index 0000000..7eefa04 --- /dev/null +++ b/.github/workflows/deploy-pypi-index.yaml @@ -0,0 +1,53 @@ +name: Deploy PyPI Index to GitHub Pages + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Generate PyPI index from releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + chmod +x .github/scripts/generate_pypi_index.py + python .github/scripts/generate_pypi_index.py + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./pypi-index + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index cbe6914..0660f62 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,7 @@ examples/paddle_case/log # Auto-generated hipified files and directories (created during ROCm build) fastsafetensors/cpp/hip/ fastsafetensors/cpp/*.hip.* -fastsafetensors/cpp/hip_compat.h \ No newline at end of file +fastsafetensors/cpp/hip_compat.h + +# Auto-generated PyPI index (generated by GitHub Actions) +pypi-index/ \ No newline at end of file From f6101fc621d6e9f2e93fe45acf4dda90378d5e5c Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Thu, 6 Nov 2025 23:47:20 +0000 Subject: [PATCH 21/48] only manual trigger when deploying pypi index Signed-off-by: tjtanaa --- .github/workflows/deploy-pypi-index.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-pypi-index.yaml b/.github/workflows/deploy-pypi-index.yaml index 7eefa04..e56efb8 100644 --- a/.github/workflows/deploy-pypi-index.yaml +++ b/.github/workflows/deploy-pypi-index.yaml @@ -1,8 +1,6 @@ name: Deploy PyPI Index to GitHub Pages on: - release: - types: [published] workflow_dispatch: permissions: From 643d12d209ed4a04bdb7e3eecc6b20068cda2821 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:01:52 +0000 Subject: [PATCH 22/48] add publish to index GA workflow Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 198 ++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 .github/workflows/publish-to-index.yaml diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml new file mode 100644 index 0000000..ebb5a29 --- /dev/null +++ b/.github/workflows/publish-to-index.yaml @@ -0,0 +1,198 @@ +name: Publish ROCm wheels to custom index + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to publish (e.g., v0.1.15-rocm)' + required: true + release: + types: [published] + +permissions: + contents: read + +jobs: + publish-to-github-pages: + name: Publish to GitHub Pages index + runs-on: ubuntu-latest + + steps: + - name: Checkout fastsafetensors-rocm repo + uses: actions/checkout@v4 + with: + path: fastsafetensors-rocm + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install tools + run: | + python -m pip install --upgrade pip + pip install dumb-pypi + + - name: Download ROCm wheels from release + env: + GH_TOKEN: ${{ github.token }} + run: | + # Determine version + if [ "${{ github.event_name }}" = "release" ]; then + VERSION="${{ github.event.release.tag_name }}" + else + VERSION="${{ github.event.inputs.version }}" + fi + + echo "Downloading wheels for ${VERSION}" + + # Create directory for wheels + mkdir -p wheels/rocm + + # Download release assets (wheels) using gh CLI + cd wheels/rocm + gh release download "${VERSION}" \ + --repo EmbeddedLLM/fastsafetensors-rocm \ + --pattern "*.whl" + + ls -lah + + - name: Download all dependencies + run: | + # Create temporary directory for dependency resolution + mkdir -p deps_temp + + # For each Python version, download dependencies + for py_ver in 3.9 3.10 3.11 3.12 3.13; do + echo "Downloading dependencies for Python ${py_ver}" + + # Create a venv for this Python version to resolve dependencies + python${py_ver} -m venv deps_temp/venv${py_ver} 2>/dev/null || { + echo "Python ${py_ver} not available, skipping" + continue + } + + source deps_temp/venv${py_ver}/bin/activate + pip install --upgrade pip + + # Download dependencies for fastsafetensors (without fastsafetensors itself) + # This gets typer and all of typer's dependencies + pip download \ + --dest wheels/rocm \ + --only-binary :all: \ + --python-version ${py_ver} \ + --platform manylinux2014_x86_64 \ + --platform manylinux_2_17_x86_64 \ + --platform manylinux_2_27_x86_64 \ + --platform manylinux_2_28_x86_64 \ + typer || echo "Failed to download for Python ${py_ver}" + + deactivate + done + + # Also download using current Python for any missing wheels + pip download \ + --dest wheels/rocm \ + --only-binary :all: \ + typer + + # Remove duplicates and list what we have + cd wheels/rocm + # Remove duplicate wheels (keep latest version) + # This is a simple deduplication - you might want more sophisticated logic + ls -1 *.whl | sort | uniq + + echo "Total wheels collected:" + ls -1 *.whl | wc -l + + echo "Wheel breakdown by package:" + ls -1 *.whl | sed 's/-[0-9].*//' | sort | uniq -c + + - name: Checkout GitHub Pages repository + uses: actions/checkout@v4 + with: + repository: EmbeddedLLM/fastsafetensors-rocm + ref: gh-pages + token: ${{ secrets.GITHUB_TOKEN }} + path: gh-pages-repo + + - name: Copy wheels and generate index + run: | + cd gh-pages-repo + + # Create directory structure + mkdir -p rocm/packages + + # Copy all wheels + cp ../wheels/rocm/*.whl rocm/packages/ + + # Generate package list + ls rocm/packages/*.whl > rocm/package-list.txt + + # Generate PEP 503 compliant index + dumb-pypi \ + --package-list rocm/package-list.txt \ + --packages-url ../packages \ + --output-dir rocm/simple \ + --title "fastsafetensors ROCm Index" + + echo "Generated index for $(ls rocm/packages/*.whl | wc -l) wheels" + + - name: Create index README + run: | + cd gh-pages-repo + + cat > rocm/README.md << 'EOF' + # fastsafetensors ROCm Package Index + + This is a custom Python package index for ROCm-built fastsafetensors wheels. + + ## Installation + + ```bash + # Install fastsafetensors with ROCm support + pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/ + ``` + + ## Available Packages + + This index includes: + - `fastsafetensors` - ROCm builds for Python 3.9-3.13 + - All dependencies (typer, click, etc.) for multiple Python versions and platforms + + ## What's Included + + EOF + + # List packages with counts + echo "### Package Inventory" >> rocm/README.md + echo "" >> rocm/README.md + ls rocm/packages/*.whl | sed 's/.*\///' | sed 's/-[0-9].*//' | sort | uniq -c | awk '{print "- " $2 ": " $1 " wheels"}' >> rocm/README.md + + - name: Commit and push to gh-pages + run: | + cd gh-pages-repo + + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + + git add rocm/ + + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "Update ROCm index - $(date +%Y-%m-%d)" + git push + echo "Successfully pushed to gh-pages branch" + fi + + - name: Summary + run: | + echo "## Published to GitHub Pages! 🎉" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Installation" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY + echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY From 0935d8c93688ae2f7f3a1712d66ec6736588fd61 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:18:29 +0000 Subject: [PATCH 23/48] fix the publish to index Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 307 ++++++++++++++++-------- 1 file changed, 212 insertions(+), 95 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index ebb5a29..610d62c 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -1,11 +1,20 @@ -name: Publish ROCm wheels to custom index +name: Publish wheels to custom index on: workflow_dispatch: inputs: version: - description: 'Version to publish (e.g., v0.1.15-rocm)' + description: 'Version to publish (e.g., v0.1.15-rocm or v0.1.15-cuda)' required: true + platform: + description: 'Platform to publish (rocm, cuda, or both)' + required: true + default: 'rocm' + type: choice + options: + - rocm + - cuda + - both release: types: [published] @@ -33,9 +42,8 @@ jobs: python -m pip install --upgrade pip pip install dumb-pypi - - name: Download ROCm wheels from release - env: - GH_TOKEN: ${{ github.token }} + - name: Determine platform and version + id: determine run: | # Determine version if [ "${{ github.event_name }}" = "release" ]; then @@ -43,70 +51,106 @@ jobs: else VERSION="${{ github.event.inputs.version }}" fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "Downloading wheels for ${VERSION}" + # Determine platform from version tag or input + if [ "${{ github.event_name }}" = "release" ]; then + if [[ "${VERSION}" == *"rocm"* ]]; then + PLATFORM="rocm" + elif [[ "${VERSION}" == *"cuda"* ]]; then + PLATFORM="cuda" + else + PLATFORM="both" + fi + else + PLATFORM="${{ github.event.inputs.platform }}" + fi + echo "platform=${PLATFORM}" >> $GITHUB_OUTPUT - # Create directory for wheels - mkdir -p wheels/rocm + echo "Publishing version: ${VERSION}" + echo "Platform: ${PLATFORM}" - # Download release assets (wheels) using gh CLI - cd wheels/rocm - gh release download "${VERSION}" \ - --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl" + - name: Download wheels from release + env: + GH_TOKEN: ${{ github.token }} + run: | + VERSION="${{ steps.determine.outputs.version }}" + PLATFORM="${{ steps.determine.outputs.platform }}" + + # Create directories + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + mkdir -p wheels/rocm + echo "Downloading ROCm wheels for ${VERSION}" + cd wheels/rocm + gh release download "${VERSION}" \ + --repo EmbeddedLLM/fastsafetensors-rocm \ + --pattern "*.whl" || echo "No ROCm wheels found" + ls -lah + cd ../.. + fi - ls -lah + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + mkdir -p wheels/cuda + echo "Downloading CUDA wheels for ${VERSION}" + cd wheels/cuda + gh release download "${VERSION}" \ + --repo EmbeddedLLM/fastsafetensors-rocm \ + --pattern "*.whl" || echo "No CUDA wheels found" + ls -lah + cd ../.. + fi - name: Download all dependencies run: | - # Create temporary directory for dependency resolution - mkdir -p deps_temp - - # For each Python version, download dependencies - for py_ver in 3.9 3.10 3.11 3.12 3.13; do - echo "Downloading dependencies for Python ${py_ver}" - - # Create a venv for this Python version to resolve dependencies - python${py_ver} -m venv deps_temp/venv${py_ver} 2>/dev/null || { - echo "Python ${py_ver} not available, skipping" - continue - } - - source deps_temp/venv${py_ver}/bin/activate - pip install --upgrade pip - - # Download dependencies for fastsafetensors (without fastsafetensors itself) - # This gets typer and all of typer's dependencies - pip download \ - --dest wheels/rocm \ + PLATFORM="${{ steps.determine.outputs.platform }}" + + # Function to download dependencies for a platform + download_deps() { + local platform=$1 + local dest_dir="wheels/${platform}" + + echo "Downloading dependencies for ${platform}..." + + # For each Python version, download dependencies + for py_ver in 3.9 3.10 3.11 3.12 3.13; do + echo "Downloading dependencies for Python ${py_ver}" + + # Download dependencies using current Python (pip handles version compatibility) + python -m pip download \ + --dest "${dest_dir}" \ + --only-binary :all: \ + --python-version ${py_ver} \ + --platform manylinux2014_x86_64 \ + --platform manylinux_2_17_x86_64 \ + --platform manylinux_2_27_x86_64 \ + --platform manylinux_2_28_x86_64 \ + typer 2>/dev/null || echo "Some downloads failed for Python ${py_ver}" + done + + # Also download using current Python for any missing wheels + python -m pip download \ + --dest "${dest_dir}" \ --only-binary :all: \ - --python-version ${py_ver} \ - --platform manylinux2014_x86_64 \ - --platform manylinux_2_17_x86_64 \ - --platform manylinux_2_27_x86_64 \ - --platform manylinux_2_28_x86_64 \ - typer || echo "Failed to download for Python ${py_ver}" - - deactivate - done - - # Also download using current Python for any missing wheels - pip download \ - --dest wheels/rocm \ - --only-binary :all: \ - typer - - # Remove duplicates and list what we have - cd wheels/rocm - # Remove duplicate wheels (keep latest version) - # This is a simple deduplication - you might want more sophisticated logic - ls -1 *.whl | sort | uniq - - echo "Total wheels collected:" - ls -1 *.whl | wc -l - - echo "Wheel breakdown by package:" - ls -1 *.whl | sed 's/-[0-9].*//' | sort | uniq -c + typer || true + + # Summary + if [ -d "${dest_dir}" ] && [ "$(ls -A ${dest_dir}/*.whl 2>/dev/null)" ]; then + echo "Total wheels collected for ${platform}:" + ls -1 "${dest_dir}"/*.whl | wc -l + + echo "Wheel breakdown by package:" + ls -1 "${dest_dir}"/*.whl | xargs -n1 basename | sed 's/-[0-9].*//' | sort | uniq -c + fi + } + + # Download for requested platforms + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + download_deps "rocm" + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + download_deps "cuda" + fi - name: Checkout GitHub Pages repository uses: actions/checkout@v4 @@ -119,80 +163,153 @@ jobs: - name: Copy wheels and generate index run: | cd gh-pages-repo + PLATFORM="${{ steps.determine.outputs.platform }}" + + # Function to generate index for a platform + generate_index() { + local platform=$1 + + echo "Generating index for ${platform}..." - # Create directory structure - mkdir -p rocm/packages + # Create directory structure + mkdir -p "${platform}/packages" - # Copy all wheels - cp ../wheels/rocm/*.whl rocm/packages/ + # Copy all wheels + if [ -d "../wheels/${platform}" ] && [ "$(ls -A ../wheels/${platform}/*.whl 2>/dev/null)" ]; then + cp ../wheels/${platform}/*.whl "${platform}/packages/" - # Generate package list - ls rocm/packages/*.whl > rocm/package-list.txt + # Generate package list + ls "${platform}/packages"/*.whl > "${platform}/package-list.txt" - # Generate PEP 503 compliant index - dumb-pypi \ - --package-list rocm/package-list.txt \ - --packages-url ../packages \ - --output-dir rocm/simple \ - --title "fastsafetensors ROCm Index" + # Generate PEP 503 compliant index + dumb-pypi \ + --package-list "${platform}/package-list.txt" \ + --packages-url ../packages \ + --output-dir "${platform}/simple" \ + --title "fastsafetensors ${platform^^} Index" - echo "Generated index for $(ls rocm/packages/*.whl | wc -l) wheels" + echo "Generated ${platform} index for $(ls ${platform}/packages/*.whl | wc -l) wheels" + else + echo "No wheels found for ${platform}, skipping index generation" + fi + } - - name: Create index README + # Generate for requested platforms + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + generate_index "rocm" + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + generate_index "cuda" + fi + + - name: Create index READMEs run: | cd gh-pages-repo + PLATFORM="${{ steps.determine.outputs.platform }}" + + # Function to create README for a platform + create_readme() { + local platform=$1 + local platform_upper=$(echo $platform | tr '[:lower:]' '[:upper:]') - cat > rocm/README.md << 'EOF' - # fastsafetensors ROCm Package Index + if [ ! -d "${platform}/packages" ] || [ ! "$(ls -A ${platform}/packages/*.whl 2>/dev/null)" ]; then + echo "No packages for ${platform}, skipping README" + return + fi - This is a custom Python package index for ROCm-built fastsafetensors wheels. + cat > "${platform}/README.md" << EOF + # fastsafetensors ${platform_upper} Package Index + + This is a custom Python package index for ${platform_upper}-built fastsafetensors wheels. ## Installation - ```bash - # Install fastsafetensors with ROCm support - pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/ - ``` + \`\`\`bash + # Install fastsafetensors with ${platform_upper} support + pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/${platform}/simple/ + \`\`\` ## Available Packages This index includes: - - `fastsafetensors` - ROCm builds for Python 3.9-3.13 + - \`fastsafetensors\` - ${platform_upper} builds for Python 3.9-3.13 - All dependencies (typer, click, etc.) for multiple Python versions and platforms ## What's Included EOF - # List packages with counts - echo "### Package Inventory" >> rocm/README.md - echo "" >> rocm/README.md - ls rocm/packages/*.whl | sed 's/.*\///' | sed 's/-[0-9].*//' | sort | uniq -c | awk '{print "- " $2 ": " $1 " wheels"}' >> rocm/README.md + # List packages with counts + echo "### Package Inventory" >> "${platform}/README.md" + echo "" >> "${platform}/README.md" + ls "${platform}/packages"/*.whl | sed 's/.*\///' | sed 's/-[0-9].*//' | sort | uniq -c | awk '{print "- " $2 ": " $1 " wheels"}' >> "${platform}/README.md" + } + + # Create READMEs for requested platforms + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + create_readme "rocm" + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + create_readme "cuda" + fi - name: Commit and push to gh-pages run: | cd gh-pages-repo + PLATFORM="${{ steps.determine.outputs.platform }}" git config user.name "GitHub Actions" git config user.email "actions@github.com" - git add rocm/ + # Add platform directories based on selection + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + git add rocm/ + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + git add cuda/ + fi if git diff --staged --quiet; then echo "No changes to commit" else - git commit -m "Update ROCm index - $(date +%Y-%m-%d)" + if [ "$PLATFORM" = "both" ]; then + git commit -m "Update ROCm and CUDA indices - $(date +%Y-%m-%d)" + elif [ "$PLATFORM" = "cuda" ]; then + git commit -m "Update CUDA index - $(date +%Y-%m-%d)" + else + git commit -m "Update ROCm index - $(date +%Y-%m-%d)" + fi git push echo "Successfully pushed to gh-pages branch" fi - name: Summary run: | + PLATFORM="${{ steps.determine.outputs.platform }}" + echo "## Published to GitHub Pages! 🎉" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Installation" >> $GITHUB_STEP_SUMMARY - echo '```bash' >> $GITHUB_STEP_SUMMARY - echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY + + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + echo "### ROCm Index" >> $GITHUB_STEP_SUMMARY + echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Installation:**" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY + echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + echo "### CUDA Index" >> $GITHUB_STEP_SUMMARY + echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/cuda/simple/" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Installation:**" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY + echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/cuda/simple/" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + fi From 378b262284728b9babecbae37189c19f7d293818 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:21:08 +0000 Subject: [PATCH 24/48] fix the publish to index write permission Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 610d62c..86fc93f 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -19,7 +19,7 @@ on: types: [published] permissions: - contents: read + contents: write jobs: publish-to-github-pages: From 5efe4a9e23e09b8faca9df9ca9466c3862c15405 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:30:37 +0000 Subject: [PATCH 25/48] fix the publish to index for both mode Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 31 +++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 86fc93f..b30c8b4 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -77,25 +77,42 @@ jobs: VERSION="${{ steps.determine.outputs.version }}" PLATFORM="${{ steps.determine.outputs.platform }}" - # Create directories + # Function to construct platform-specific version tag + get_version_tag() { + local platform=$1 + local version="${VERSION}" + + # If version already has platform suffix, use as-is + if [[ "${version}" == *"-${platform}"* ]]; then + echo "${version}" + else + # Otherwise append platform suffix + echo "${version}-${platform}" + fi + } + + # Download ROCm wheels if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + ROCM_VERSION=$(get_version_tag "rocm") mkdir -p wheels/rocm - echo "Downloading ROCm wheels for ${VERSION}" + echo "Downloading ROCm wheels from release ${ROCM_VERSION}" cd wheels/rocm - gh release download "${VERSION}" \ + gh release download "${ROCM_VERSION}" \ --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl" || echo "No ROCm wheels found" + --pattern "*.whl" || echo "Warning: No ROCm wheels found for ${ROCM_VERSION}" ls -lah cd ../.. fi + # Download CUDA wheels if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + CUDA_VERSION=$(get_version_tag "cuda") mkdir -p wheels/cuda - echo "Downloading CUDA wheels for ${VERSION}" + echo "Downloading CUDA wheels from release ${CUDA_VERSION}" cd wheels/cuda - gh release download "${VERSION}" \ + gh release download "${CUDA_VERSION}" \ --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl" || echo "No CUDA wheels found" + --pattern "*.whl" || echo "Warning: No CUDA wheels found for ${CUDA_VERSION}" ls -lah cd ../.. fi From 8871043c722a4583d651921338fdafa4ac3ab624 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:41:17 +0000 Subject: [PATCH 26/48] fix the manylinux rocmwheel build Signed-off-by: tjtanaa --- .github/workflows/build-rocm-wheels.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml index 80e5ed4..142ee78 100644 --- a/.github/workflows/build-rocm-wheels.yaml +++ b/.github/workflows/build-rocm-wheels.yaml @@ -36,7 +36,8 @@ jobs: make \ git \ curl \ - ca-certificates + ca-certificates \ + patchelf - name: Install Python ${{ matrix.python-version }} run: | From 619c531d631c0a7edb2aa72c5045c1224cbe9da1 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:49:51 +0000 Subject: [PATCH 27/48] update publish to index Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index b30c8b4..142eb71 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -42,6 +42,14 @@ jobs: python -m pip install --upgrade pip pip install dumb-pypi + # Install GitHub CLI + type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install gh -y + - name: Determine platform and version id: determine run: | @@ -97,9 +105,13 @@ jobs: mkdir -p wheels/rocm echo "Downloading ROCm wheels from release ${ROCM_VERSION}" cd wheels/rocm - gh release download "${ROCM_VERSION}" \ + if ! gh release download "${ROCM_VERSION}" \ --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl" || echo "Warning: No ROCm wheels found for ${ROCM_VERSION}" + --pattern "*.whl"; then + echo "ERROR: Failed to download ROCm wheels from ${ROCM_VERSION}" + exit 1 + fi + echo "Downloaded wheels:" ls -lah cd ../.. fi @@ -110,9 +122,13 @@ jobs: mkdir -p wheels/cuda echo "Downloading CUDA wheels from release ${CUDA_VERSION}" cd wheels/cuda - gh release download "${CUDA_VERSION}" \ + if ! gh release download "${CUDA_VERSION}" \ --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl" || echo "Warning: No CUDA wheels found for ${CUDA_VERSION}" + --pattern "*.whl"; then + echo "ERROR: Failed to download CUDA wheels from ${CUDA_VERSION}" + exit 1 + fi + echo "Downloaded wheels:" ls -lah cd ../.. fi From 6a3f302e50147e1fd3b564f995c9bcbd95ae5b26 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 01:58:27 +0000 Subject: [PATCH 28/48] fix nested dumb-pypi Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 142eb71..01ffbaf 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -215,10 +215,11 @@ jobs: ls "${platform}/packages"/*.whl > "${platform}/package-list.txt" # Generate PEP 503 compliant index + # Note: dumb-pypi creates a /simple/ subdirectory inside output-dir dumb-pypi \ --package-list "${platform}/package-list.txt" \ --packages-url ../packages \ - --output-dir "${platform}/simple" \ + --output-dir "${platform}" \ --title "fastsafetensors ${platform^^} Index" echo "Generated ${platform} index for $(ls ${platform}/packages/*.whl | wc -l) wheels" From c3a580b31a47802ee60e0c98d0109b3c66ea8e0b Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 02:04:35 +0000 Subject: [PATCH 29/48] fix publish to index Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 01ffbaf..973cf10 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -204,6 +204,12 @@ jobs: echo "Generating index for ${platform}..." + # Clean up old index files to avoid conflicts + rm -rf "${platform}/simple" + rm -f "${platform}/package-list.txt" + rm -f "${platform}/index.html" + rm -f "${platform}/packages.json" + # Create directory structure mkdir -p "${platform}/packages" @@ -211,11 +217,15 @@ jobs: if [ -d "../wheels/${platform}" ] && [ "$(ls -A ../wheels/${platform}/*.whl 2>/dev/null)" ]; then cp ../wheels/${platform}/*.whl "${platform}/packages/" - # Generate package list - ls "${platform}/packages"/*.whl > "${platform}/package-list.txt" + # Generate package list with absolute paths + find "${platform}/packages" -name "*.whl" -type f > "${platform}/package-list.txt" + + echo "Package list contents:" + cat "${platform}/package-list.txt" # Generate PEP 503 compliant index # Note: dumb-pypi creates a /simple/ subdirectory inside output-dir + # packages-url is relative from simple/ to packages/: ../packages dumb-pypi \ --package-list "${platform}/package-list.txt" \ --packages-url ../packages \ @@ -223,6 +233,11 @@ jobs: --title "fastsafetensors ${platform^^} Index" echo "Generated ${platform} index for $(ls ${platform}/packages/*.whl | wc -l) wheels" + + # Debug: show generated structure + echo "Generated structure:" + ls -la "${platform}/simple/" || echo "No simple/ directory created" + ls -la "${platform}/simple/fastsafetensors/" || echo "No fastsafetensors/ directory created" else echo "No wheels found for ${platform}, skipping index generation" fi From 4eca2b7a8bc3330493204938a7c967d1a9bdb9cb Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 02:15:43 +0000 Subject: [PATCH 30/48] fix the dumb-pypi Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 973cf10..f3f1c8f 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -217,20 +217,22 @@ jobs: if [ -d "../wheels/${platform}" ] && [ "$(ls -A ../wheels/${platform}/*.whl 2>/dev/null)" ]; then cp ../wheels/${platform}/*.whl "${platform}/packages/" - # Generate package list with absolute paths - find "${platform}/packages" -name "*.whl" -type f > "${platform}/package-list.txt" + # Generate package list with just filenames (dumb-pypi doesn't accept paths with /) + (cd "${platform}/packages" && ls *.whl) > "${platform}/package-list.txt" echo "Package list contents:" cat "${platform}/package-list.txt" # Generate PEP 503 compliant index - # Note: dumb-pypi creates a /simple/ subdirectory inside output-dir + # Note: dumb-pypi expects wheel files to be accessible from where it runs + # Run from packages/ directory so dumb-pypi can find the wheels by filename # packages-url is relative from simple/ to packages/: ../packages - dumb-pypi \ - --package-list "${platform}/package-list.txt" \ - --packages-url ../packages \ - --output-dir "${platform}" \ - --title "fastsafetensors ${platform^^} Index" + (cd "${platform}/packages" && \ + dumb-pypi \ + --package-list ../package-list.txt \ + --packages-url ../packages \ + --output-dir .. \ + --title "fastsafetensors ${platform^^} Index") echo "Generated ${platform} index for $(ls ${platform}/packages/*.whl | wc -l) wheels" From 2f158982d17fd70a855e35c17f3bc3b7d12355e2 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 02:22:27 +0000 Subject: [PATCH 31/48] fix the package path Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index f3f1c8f..e3650f3 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -226,11 +226,11 @@ jobs: # Generate PEP 503 compliant index # Note: dumb-pypi expects wheel files to be accessible from where it runs # Run from packages/ directory so dumb-pypi can find the wheels by filename - # packages-url is relative from simple/ to packages/: ../packages + # packages-url is relative from simple/fastsafetensors/ to packages/: ../../packages (cd "${platform}/packages" && \ dumb-pypi \ --package-list ../package-list.txt \ - --packages-url ../packages \ + --packages-url ../../packages \ --output-dir .. \ --title "fastsafetensors ${platform^^} Index") From 8ffcefa679ed68386667ad2479024195571df887 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 04:50:15 +0000 Subject: [PATCH 32/48] lint Signed-off-by: tjtanaa --- fastsafetensors/copier/gds.py | 2 +- fastsafetensors/frameworks/_paddle.py | 4 ++-- fastsafetensors/frameworks/_torch.py | 4 ++-- tests/test_fastsafetensors.py | 8 +++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fastsafetensors/copier/gds.py b/fastsafetensors/copier/gds.py index dc24f1f..c212d0d 100644 --- a/fastsafetensors/copier/gds.py +++ b/fastsafetensors/copier/gds.py @@ -28,7 +28,7 @@ def __init__( self.copy_reqs: Dict[int, int] = {} self.aligned_length = 0 cuda_ver = framework.get_cuda_ver() - if cuda_ver and cuda_ver != "none": + if cuda_ver and cuda_ver != "0.0": # Parse version string (e.g., "cuda-12.1" or "hip-5.7.0") # Extract the numeric part after the platform prefix ver_parts = cuda_ver.split("-", 1) diff --git a/fastsafetensors/frameworks/_paddle.py b/fastsafetensors/frameworks/_paddle.py index 7592d31..8ced6eb 100644 --- a/fastsafetensors/frameworks/_paddle.py +++ b/fastsafetensors/frameworks/_paddle.py @@ -217,7 +217,7 @@ def get_cuda_ver(self) -> str: """Get GPU runtime version with platform indicator. Returns a string like 'hip-5.7.0' for ROCm or 'cuda-12.1' for CUDA, - or 'none' if no GPU is available. This allows code to distinguish + or '0.0' if no GPU is available. This allows code to distinguish between different GPU platforms without using paddle directly. """ if paddle.device.is_compiled_with_cuda(): @@ -225,7 +225,7 @@ def get_cuda_ver(self) -> str: if paddle.device.is_compiled_with_rocm(): return f"hip-{paddle.version.cuda()}" return f"cuda-{paddle.version.cuda()}" - return "none" + return "0.0" def get_device_ptr_align(self) -> int: CUDA_PTR_ALIGN: int = 16 diff --git a/fastsafetensors/frameworks/_torch.py b/fastsafetensors/frameworks/_torch.py index affa214..aeb8084 100644 --- a/fastsafetensors/frameworks/_torch.py +++ b/fastsafetensors/frameworks/_torch.py @@ -189,7 +189,7 @@ def get_cuda_ver(self) -> str: """Get GPU runtime version with platform indicator. Returns a string like 'hip-5.7.0' for ROCm or 'cuda-12.1' for CUDA, - or 'none' if no GPU is available. This allows code to distinguish + or '0.0' if no GPU is available. This allows code to distinguish between different GPU platforms without using torch directly. """ if torch.cuda.is_available(): @@ -197,7 +197,7 @@ def get_cuda_ver(self) -> str: if hasattr(torch.version, "hip") and torch.version.hip is not None: return f"hip-{torch.version.hip}" return f"cuda-{torch.version.cuda}" - return "none" + return "0.0" def get_device_ptr_align(self) -> int: CUDA_PTR_ALIGN: int = 16 diff --git a/tests/test_fastsafetensors.py b/tests/test_fastsafetensors.py index 118e2ca..1f4ff28 100644 --- a/tests/test_fastsafetensors.py +++ b/tests/test_fastsafetensors.py @@ -113,11 +113,9 @@ def test_framework(fstcpp_log, framework) -> None: # Test that get_cuda_ver() returns a string with platform prefix cuda_ver = framework.get_cuda_ver() assert isinstance(cuda_ver, str) - # Should be "hip-X.Y.Z", "cuda-X.Y", or "none" + # Should be "hip-X.Y.Z", "cuda-X.Y", or "0.0" assert ( - cuda_ver.startswith("hip-") - or cuda_ver.startswith("cuda-") - or cuda_ver == "none" + cuda_ver.startswith("hip-") or cuda_ver.startswith("cuda-") or cuda_ver == "0.0" ) # Verify it matches what torch reports @@ -132,7 +130,7 @@ def test_framework(fstcpp_log, framework) -> None: assert cuda_ver.startswith("cuda-") assert str(torch.version.cuda) in cuda_ver else: - assert cuda_ver == "none" + assert cuda_ver == "0.0" def test_get_framework_fail(fstcpp_log) -> None: From f09cb5430440b12aafe452885379116b35debcb5 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 04:57:52 +0000 Subject: [PATCH 33/48] remove deploy-pypi-index Signed-off-by: tjtanaa --- .github/scripts/generate_pypi_index.py | 228 ----------------------- .github/workflows/deploy-pypi-index.yaml | 51 ----- 2 files changed, 279 deletions(-) delete mode 100755 .github/scripts/generate_pypi_index.py delete mode 100644 .github/workflows/deploy-pypi-index.yaml diff --git a/.github/scripts/generate_pypi_index.py b/.github/scripts/generate_pypi_index.py deleted file mode 100755 index eb360d9..0000000 --- a/.github/scripts/generate_pypi_index.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/env python3 -""" -Generate PyPI-compatible simple index from GitHub releases. -This script fetches all releases and creates separate indexes for CUDA and ROCm wheels. -""" - -import json -import os -import sys -from pathlib import Path -from urllib.request import urlopen, Request - -def fetch_releases(repo_owner, repo_name): - """Fetch all releases from GitHub API.""" - url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/releases" - headers = { - "Accept": "application/vnd.github.v3+json", - "User-Agent": "PyPI-Index-Generator" - } - - # Add GitHub token if available (for higher rate limits) - token = os.environ.get("GITHUB_TOKEN") - if token: - headers["Authorization"] = f"token {token}" - - request = Request(url, headers=headers) - - try: - with urlopen(request) as response: - return json.loads(response.read().decode()) - except Exception as e: - print(f"Error fetching releases: {e}", file=sys.stderr) - sys.exit(1) - -def categorize_backend(release_tag): - """Determine backend (cuda/rocm) from release tag.""" - tag_lower = release_tag.lower() - - if "rocm" in tag_lower: - return "rocm" - elif "cuda" in tag_lower: - return "cuda" - else: - # Default to cuda for untagged releases - return "cuda" - -def extract_wheels_by_backend(releases): - """Extract wheel files from releases, categorized by backend.""" - wheels_by_backend = { - "cuda": [], - "rocm": [] - } - - for release in releases: - backend = categorize_backend(release.get("tag_name", "")) - - for asset in release.get("assets", []): - name = asset.get("name", "") - if name.endswith(".whl"): - wheels_by_backend[backend].append({ - "name": name, - "url": asset.get("browser_download_url"), - "version": release.get("tag_name"), - }) - - return wheels_by_backend - -def generate_root_index(output_dir, packages): - """Generate the root simple index.""" - html = """ - - - - Simple Index - - -

Simple Index

-""" - - for package in sorted(packages): - html += f' {package}
\n' - - html += """ - -""" - - output_path = output_dir / "index.html" - output_path.write_text(html) - print(f"Generated: {output_path}") - -def generate_package_index(output_dir, package_name, wheels): - """Generate package-specific index with all wheels.""" - html = f""" - - - - Links for {package_name} - - -

Links for {package_name}

-""" - - # Sort wheels by version and Python version - sorted_wheels = sorted(wheels, key=lambda w: (w["name"], w["version"]), reverse=True) - - for wheel in sorted_wheels: - # Extract package name from wheel filename to ensure consistency - wheel_name = wheel["name"] - url = wheel["url"] - html += f' {wheel_name}
\n' - - html += """ - -""" - - package_dir = output_dir / package_name - package_dir.mkdir(parents=True, exist_ok=True) - - output_path = package_dir / "index.html" - output_path.write_text(html) - print(f"Generated: {output_path}") - -def generate_landing_page(base_dir, repo_name): - """Generate a landing page for the PyPI index.""" - html = f""" - - - - {repo_name} - PyPI Index - - - -

{repo_name} - PyPI Index

-

Choose the appropriate index URL based on your GPU backend:

- -
-

🔥 ROCm (AMD GPUs)

-

For AMD GPUs using ROCm:

-
pip install fastsafetensors --index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
-
- -
-

💚 CUDA (NVIDIA GPUs)

-

For NVIDIA GPUs using CUDA:

-
pip install fastsafetensors --index-url https://embeddedllm.github.io/{repo_name}/cuda/simple/
-
- -

Version Specific Installation

-
pip install fastsafetensors==0.1.15 --index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
- -

In requirements.txt

-
--index-url https://embeddedllm.github.io/{repo_name}/rocm/simple/
-fastsafetensors>=0.1.15
- -
-

Direct access: ROCm Index | CUDA Index

- - -""" - - output_path = base_dir / "index.html" - output_path.write_text(html) - print(f"Generated landing page: {output_path}") - -def main(): - # Configuration - repo_owner = os.environ.get("GITHUB_REPOSITORY_OWNER", "EmbeddedLLM") - repo_full = os.environ.get("GITHUB_REPOSITORY", "EmbeddedLLM/fastsafetensors-rocm") - repo_name = repo_full.split("/")[-1] - - print(f"Fetching releases from {repo_owner}/{repo_name}...") - releases = fetch_releases(repo_owner, repo_name) - print(f"Found {len(releases)} releases") - - # Extract wheels categorized by backend - wheels_by_backend = extract_wheels_by_backend(releases) - - total_wheels = sum(len(wheels) for wheels in wheels_by_backend.values()) - print(f"Found {total_wheels} total wheel files") - print(f" CUDA: {len(wheels_by_backend['cuda'])} wheels") - print(f" ROCm: {len(wheels_by_backend['rocm'])} wheels") - - if total_wheels == 0: - print("Warning: No wheel files found in any release", file=sys.stderr) - return - - # Generate indexes for each backend - for backend, wheels in wheels_by_backend.items(): - if not wheels: - print(f"Skipping {backend} index (no wheels found)") - continue - - print(f"\nGenerating {backend.upper()} index...") - output_dir = Path(f"pypi-index/{backend}/simple") - output_dir.mkdir(parents=True, exist_ok=True) - - # Group wheels by package name - packages = {} - for wheel in wheels: - # Extract package name from wheel filename (before first dash) - package_name = wheel["name"].split("-")[0] - if package_name not in packages: - packages[package_name] = [] - packages[package_name].append(wheel) - - # Generate indexes - generate_root_index(output_dir, packages.keys()) - - for package_name, package_wheels in packages.items(): - generate_package_index(output_dir, package_name, package_wheels) - - print(f" Generated {backend.upper()} index with {len(packages)} package(s)") - - # Generate landing page - base_dir = Path("pypi-index") - generate_landing_page(base_dir, repo_name) - - print(f"\n✓ Successfully generated indexes for all backends") - print(f" Total wheels: {total_wheels}") - -if __name__ == "__main__": - main() diff --git a/.github/workflows/deploy-pypi-index.yaml b/.github/workflows/deploy-pypi-index.yaml deleted file mode 100644 index e56efb8..0000000 --- a/.github/workflows/deploy-pypi-index.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Deploy PyPI Index to GitHub Pages - -on: - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Generate PyPI index from releases - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - chmod +x .github/scripts/generate_pypi_index.py - python .github/scripts/generate_pypi_index.py - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./pypi-index - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 From 821fb41ad72840428dcf91b6c11baa0abeeb8760 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 05:08:45 +0000 Subject: [PATCH 34/48] remove unused code Signed-off-by: tjtanaa --- tests/platform_utils.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/platform_utils.py b/tests/platform_utils.py index e0b4498..d9da5f6 100644 --- a/tests/platform_utils.py +++ b/tests/platform_utils.py @@ -29,18 +29,6 @@ def is_cuda_platform(): "test_GdsFileCopier", # GDS not available on AMD } -# List of tests with memory leak detection issues on ROCm (non-critical) -ROCM_MEMORY_LEAK_TESTS = { - "test_SafeTensorsFileLoader", - "test_SafeTensorsFileLoaderNoGds", - "test_fastsafe_open", - "test_int8", - "test_float8_e5m2", - "test_float8_e4m3fn", - "test_float8_e4m3fn_to_int8", - "test_cpp_metrics", -} - def skip_if_rocm_expected_failure(test_name): """Skip test if it's an expected failure on ROCm.""" @@ -50,16 +38,6 @@ def skip_if_rocm_expected_failure(test_name): ) -def xfail_if_rocm_memory_leak(test_name): - """Mark test as expected to fail on ROCm due to memory leak detection issues.""" - if is_rocm_platform() and test_name in ROCM_MEMORY_LEAK_TESTS: - return pytest.mark.xfail( - reason=f"Test '{test_name}' has memory leak detection issues on ROCm (non-critical)", - strict=False, - ) - return lambda func: func - - def get_platform_info(): """Get platform information for debugging. From e9ff27f67372494d1f760908d4b3310618bbc8f5 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 05:37:50 +0000 Subject: [PATCH 35/48] update publish to index to handle version isolation Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 155 +++++++++++++++++++++++- 1 file changed, 152 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index e3650f3..8609d9c 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -133,6 +133,93 @@ jobs: cd ../.. fi + - name: Extract dependencies from wheels + run: | + PLATFORM="${{ steps.determine.outputs.platform }}" + VERSION="${{ steps.determine.outputs.version }}" + + # Python script to extract dependencies from wheel metadata + cat > extract_deps.py << 'PYTHON_SCRIPT' +import sys +import zipfile +import re +from pathlib import Path + +def extract_dependencies(wheel_path): + """Extract Requires-Dist from wheel METADATA.""" + dependencies = [] + + try: + with zipfile.ZipFile(wheel_path, 'r') as whl: + # Find METADATA file (usually in *.dist-info/METADATA) + metadata_files = [f for f in whl.namelist() if f.endswith('.dist-info/METADATA')] + + if not metadata_files: + print(f"Warning: No METADATA found in {wheel_path}", file=sys.stderr) + return dependencies + + metadata_content = whl.read(metadata_files[0]).decode('utf-8') + + # Parse Requires-Dist lines + for line in metadata_content.split('\n'): + line = line.strip() + if line.startswith('Requires-Dist:'): + # Extract dependency specification + dep = line.split(':', 1)[1].strip() + # Remove extras and environment markers + dep = re.split(r'\s*;\s*', dep)[0] + dep = re.split(r'\s*\[', dep)[0] + dependencies.append(dep) + + except Exception as e: + print(f"Error reading {wheel_path}: {e}", file=sys.stderr) + + return dependencies + +if __name__ == "__main__": + wheel_dir = sys.argv[1] + wheel_files = list(Path(wheel_dir).glob("fastsafetensors-*.whl")) + + if not wheel_files: + print("Error: No fastsafetensors wheels found", file=sys.stderr) + sys.exit(1) + + # Use first wheel (all should have same dependencies) + wheel_path = wheel_files[0] + print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) + + deps = extract_dependencies(wheel_path) + + # Output dependencies one per line + for dep in deps: + print(dep) +PYTHON_SCRIPT + + # Extract dependencies for each platform + extract_deps_for_platform() { + local platform=$1 + local wheel_dir="wheels/${platform}" + + if [ ! -d "${wheel_dir}" ]; then + echo "No wheels directory for ${platform}" + return + fi + + echo "Extracting dependencies from ${platform} wheels..." + python extract_deps.py "${wheel_dir}" > "${wheel_dir}/requirements.txt" 2>&1 + + echo "Extracted dependencies:" + cat "${wheel_dir}/requirements.txt" + } + + if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then + extract_deps_for_platform "rocm" + fi + + if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then + extract_deps_for_platform "cuda" + fi + - name: Download all dependencies run: | PLATFORM="${{ steps.determine.outputs.platform }}" @@ -141,14 +228,20 @@ jobs: download_deps() { local platform=$1 local dest_dir="wheels/${platform}" + local req_file="${dest_dir}/requirements.txt" echo "Downloading dependencies for ${platform}..." + if [ ! -f "${req_file}" ]; then + echo "No requirements file found for ${platform}, skipping" + return + fi + # For each Python version, download dependencies for py_ver in 3.9 3.10 3.11 3.12 3.13; do echo "Downloading dependencies for Python ${py_ver}" - # Download dependencies using current Python (pip handles version compatibility) + # Download dependencies using extracted requirements python -m pip download \ --dest "${dest_dir}" \ --only-binary :all: \ @@ -157,14 +250,14 @@ jobs: --platform manylinux_2_17_x86_64 \ --platform manylinux_2_27_x86_64 \ --platform manylinux_2_28_x86_64 \ - typer 2>/dev/null || echo "Some downloads failed for Python ${py_ver}" + -r "${req_file}" 2>/dev/null || echo "Some downloads failed for Python ${py_ver}" done # Also download using current Python for any missing wheels python -m pip download \ --dest "${dest_dir}" \ --only-binary :all: \ - typer || true + -r "${req_file}" || true # Summary if [ -d "${dest_dir}" ] && [ "$(ls -A ${dest_dir}/*.whl 2>/dev/null)" ]; then @@ -197,10 +290,12 @@ jobs: run: | cd gh-pages-repo PLATFORM="${{ steps.determine.outputs.platform }}" + VERSION="${{ steps.determine.outputs.version }}" # Function to generate index for a platform generate_index() { local platform=$1 + local version="${VERSION}" echo "Generating index for ${platform}..." @@ -212,9 +307,19 @@ jobs: # Create directory structure mkdir -p "${platform}/packages" + mkdir -p "${platform}/manifests" # Copy all wheels if [ -d "../wheels/${platform}" ] && [ "$(ls -A ../wheels/${platform}/*.whl 2>/dev/null)" ]; then + # Extract version number (remove 'v' prefix if present) + local clean_version="${version#v}" + + # Remove OLD wheels for the SAME version only + echo "Removing old fastsafetensors-${clean_version} wheels..." + rm -f "${platform}/packages/fastsafetensors-${clean_version}"-*.whl || true + + # Copy new wheels + echo "Copying new wheels..." cp ../wheels/${platform}/*.whl "${platform}/packages/" # Generate package list with just filenames (dumb-pypi doesn't accept paths with /) @@ -223,6 +328,50 @@ jobs: echo "Package list contents:" cat "${platform}/package-list.txt" + # Create manifest for this version + echo "Creating manifest for version ${clean_version}..." + local manifest_file="${platform}/manifests/v${clean_version}.json" + + # Read dependencies from requirements.txt + local deps_json="[]" + if [ -f "../wheels/${platform}/requirements.txt" ]; then + deps_json=$(python3 -c " +import json +with open('../wheels/${platform}/requirements.txt') as f: + deps = [line.strip() for line in f if line.strip() and not line.startswith('#')] +print(json.dumps(deps)) +") + fi + + # List fastsafetensors wheels + local fst_wheels_json=$(cd "${platform}/packages" && python3 -c " +import json, glob +wheels = sorted([f for f in glob.glob('fastsafetensors-${clean_version}-*.whl')]) +print(json.dumps(wheels)) +") + + # List all downloaded wheels + local all_wheels_json=$(cd "${platform}/packages" && python3 -c " +import json, glob +wheels = sorted(glob.glob('*.whl')) +print(json.dumps(wheels)) +") + + # Create manifest JSON + cat > "${manifest_file}" << EOF +{ + "fastsafetensors_version": "${clean_version}", + "published_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", + "platform": "${platform}", + "dependencies": ${deps_json}, + "fastsafetensors_wheels": ${fst_wheels_json}, + "total_wheels_in_index": $(echo ${all_wheels_json} | python3 -c "import json, sys; print(len(json.load(sys.stdin)))") +} +EOF + + echo "Created manifest:" + cat "${manifest_file}" + # Generate PEP 503 compliant index # Note: dumb-pypi expects wheel files to be accessible from where it runs # Run from packages/ directory so dumb-pypi can find the wheels by filename From eff48c76096ade2e8c3131ef0387ed74c614e49e Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 05:41:56 +0000 Subject: [PATCH 36/48] fix publish to index yaml syntax Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 77 ++++++++++++------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 8609d9c..ad031be 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -138,37 +138,46 @@ jobs: PLATFORM="${{ steps.determine.outputs.platform }}" VERSION="${{ steps.determine.outputs.version }}" - # Python script to extract dependencies from wheel metadata - cat > extract_deps.py << 'PYTHON_SCRIPT' + # Extract dependencies for each platform + extract_deps_for_platform() { + local platform=$1 + export WHEEL_DIR="wheels/${platform}" + export OUTPUT_FILE="wheels/${platform}/requirements.txt" + + if [ ! -d "${WHEEL_DIR}" ]; then + echo "No wheels directory for ${platform}" + return + fi + + echo "Extracting dependencies from ${platform} wheels..." + + python3 -c ' import sys import zipfile import re from pathlib import Path +import os def extract_dependencies(wheel_path): """Extract Requires-Dist from wheel METADATA.""" dependencies = [] try: - with zipfile.ZipFile(wheel_path, 'r') as whl: - # Find METADATA file (usually in *.dist-info/METADATA) - metadata_files = [f for f in whl.namelist() if f.endswith('.dist-info/METADATA')] + with zipfile.ZipFile(wheel_path, "r") as whl: + metadata_files = [f for f in whl.namelist() if f.endswith(".dist-info/METADATA")] if not metadata_files: print(f"Warning: No METADATA found in {wheel_path}", file=sys.stderr) return dependencies - metadata_content = whl.read(metadata_files[0]).decode('utf-8') + metadata_content = whl.read(metadata_files[0]).decode("utf-8") - # Parse Requires-Dist lines - for line in metadata_content.split('\n'): + for line in metadata_content.split("\n"): line = line.strip() - if line.startswith('Requires-Dist:'): - # Extract dependency specification - dep = line.split(':', 1)[1].strip() - # Remove extras and environment markers - dep = re.split(r'\s*;\s*', dep)[0] - dep = re.split(r'\s*\[', dep)[0] + if line.startswith("Requires-Dist:"): + dep = line.split(":", 1)[1].strip() + dep = re.split(r"\s*;\s*", dep)[0] + dep = re.split(r"\s*\[", dep)[0] dependencies.append(dep) except Exception as e: @@ -176,40 +185,28 @@ def extract_dependencies(wheel_path): return dependencies -if __name__ == "__main__": - wheel_dir = sys.argv[1] - wheel_files = list(Path(wheel_dir).glob("fastsafetensors-*.whl")) +wheel_dir = os.environ["WHEEL_DIR"] +output_file = os.environ["OUTPUT_FILE"] +wheel_files = list(Path(wheel_dir).glob("fastsafetensors-*.whl")) - if not wheel_files: - print("Error: No fastsafetensors wheels found", file=sys.stderr) - sys.exit(1) +if not wheel_files: + print("Error: No fastsafetensors wheels found", file=sys.stderr) + sys.exit(1) - # Use first wheel (all should have same dependencies) - wheel_path = wheel_files[0] - print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) +wheel_path = wheel_files[0] +print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) - deps = extract_dependencies(wheel_path) +deps = extract_dependencies(wheel_path) - # Output dependencies one per line +with open(output_file, "w") as f: for dep in deps: - print(dep) -PYTHON_SCRIPT + f.write(dep + "\n") - # Extract dependencies for each platform - extract_deps_for_platform() { - local platform=$1 - local wheel_dir="wheels/${platform}" - - if [ ! -d "${wheel_dir}" ]; then - echo "No wheels directory for ${platform}" - return - fi - - echo "Extracting dependencies from ${platform} wheels..." - python extract_deps.py "${wheel_dir}" > "${wheel_dir}/requirements.txt" 2>&1 +print(f"Wrote {len(deps)} dependencies to {output_file}", file=sys.stderr) +' echo "Extracted dependencies:" - cat "${wheel_dir}/requirements.txt" + cat "${OUTPUT_FILE}" } if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then From 4dcbb76d9a86f8b2ef95a1d4f2516d8dd03150a3 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 05:48:05 +0000 Subject: [PATCH 37/48] fix publish to index syntax error Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 98 +++---------------------- 1 file changed, 11 insertions(+), 87 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index ad031be..89192f0 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -138,75 +138,21 @@ jobs: PLATFORM="${{ steps.determine.outputs.platform }}" VERSION="${{ steps.determine.outputs.version }}" - # Extract dependencies for each platform extract_deps_for_platform() { local platform=$1 - export WHEEL_DIR="wheels/${platform}" - export OUTPUT_FILE="wheels/${platform}/requirements.txt" + local wheel_dir="wheels/${platform}" + local output_file="wheels/${platform}/requirements.txt" - if [ ! -d "${WHEEL_DIR}" ]; then + if [ ! -d "${wheel_dir}" ]; then echo "No wheels directory for ${platform}" return fi echo "Extracting dependencies from ${platform} wheels..." - - python3 -c ' -import sys -import zipfile -import re -from pathlib import Path -import os - -def extract_dependencies(wheel_path): - """Extract Requires-Dist from wheel METADATA.""" - dependencies = [] - - try: - with zipfile.ZipFile(wheel_path, "r") as whl: - metadata_files = [f for f in whl.namelist() if f.endswith(".dist-info/METADATA")] - - if not metadata_files: - print(f"Warning: No METADATA found in {wheel_path}", file=sys.stderr) - return dependencies - - metadata_content = whl.read(metadata_files[0]).decode("utf-8") - - for line in metadata_content.split("\n"): - line = line.strip() - if line.startswith("Requires-Dist:"): - dep = line.split(":", 1)[1].strip() - dep = re.split(r"\s*;\s*", dep)[0] - dep = re.split(r"\s*\[", dep)[0] - dependencies.append(dep) - - except Exception as e: - print(f"Error reading {wheel_path}: {e}", file=sys.stderr) - - return dependencies - -wheel_dir = os.environ["WHEEL_DIR"] -output_file = os.environ["OUTPUT_FILE"] -wheel_files = list(Path(wheel_dir).glob("fastsafetensors-*.whl")) - -if not wheel_files: - print("Error: No fastsafetensors wheels found", file=sys.stderr) - sys.exit(1) - -wheel_path = wheel_files[0] -print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) - -deps = extract_dependencies(wheel_path) - -with open(output_file, "w") as f: - for dep in deps: - f.write(dep + "\n") - -print(f"Wrote {len(deps)} dependencies to {output_file}", file=sys.stderr) -' + python3 fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py "${wheel_dir}" "${output_file}" echo "Extracted dependencies:" - cat "${OUTPUT_FILE}" + cat "${output_file}" } if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then @@ -332,39 +278,17 @@ print(f"Wrote {len(deps)} dependencies to {output_file}", file=sys.stderr) # Read dependencies from requirements.txt local deps_json="[]" if [ -f "../wheels/${platform}/requirements.txt" ]; then - deps_json=$(python3 -c " -import json -with open('../wheels/${platform}/requirements.txt') as f: - deps = [line.strip() for line in f if line.strip() and not line.startswith('#')] -print(json.dumps(deps)) -") + deps_json=$(python3 -c 'import json,sys; print(json.dumps([line.strip() for line in open("../wheels/'${platform}'/requirements.txt") if line.strip() and not line.startswith("#")]))') fi # List fastsafetensors wheels - local fst_wheels_json=$(cd "${platform}/packages" && python3 -c " -import json, glob -wheels = sorted([f for f in glob.glob('fastsafetensors-${clean_version}-*.whl')]) -print(json.dumps(wheels)) -") + local fst_wheels_json=$(cd "${platform}/packages" && python3 -c 'import json,glob; print(json.dumps(sorted(glob.glob("fastsafetensors-'${clean_version}'-*.whl"))))') # List all downloaded wheels - local all_wheels_json=$(cd "${platform}/packages" && python3 -c " -import json, glob -wheels = sorted(glob.glob('*.whl')) -print(json.dumps(wheels)) -") - - # Create manifest JSON - cat > "${manifest_file}" << EOF -{ - "fastsafetensors_version": "${clean_version}", - "published_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", - "platform": "${platform}", - "dependencies": ${deps_json}, - "fastsafetensors_wheels": ${fst_wheels_json}, - "total_wheels_in_index": $(echo ${all_wheels_json} | python3 -c "import json, sys; print(len(json.load(sys.stdin)))") -} -EOF + local all_wheels_json=$(cd "${platform}/packages" && python3 -c 'import json,glob; print(json.dumps(sorted(glob.glob("*.whl"))))') + + # Create manifest JSON using Python + python3 -c "import json,sys; manifest={'fastsafetensors_version':'${clean_version}','published_at':'$(date -u +%Y-%m-%dT%H:%M:%SZ)','platform':'${platform}','dependencies':${deps_json},'fastsafetensors_wheels':${fst_wheels_json},'total_wheels_in_index':len(${all_wheels_json})}; json.dump(manifest,open('${manifest_file}','w'),indent=2)" echo "Created manifest:" cat "${manifest_file}" From 86faab47d73103fc5ad20bd276154551feaf53df Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 05:48:32 +0000 Subject: [PATCH 38/48] add workflow python script Signed-off-by: tjtanaa --- .github/scripts/extract_wheel_deps.py | 75 +++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/scripts/extract_wheel_deps.py diff --git a/.github/scripts/extract_wheel_deps.py b/.github/scripts/extract_wheel_deps.py new file mode 100644 index 0000000..79eff27 --- /dev/null +++ b/.github/scripts/extract_wheel_deps.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""Extract dependencies from wheel METADATA file.""" + +import sys +import zipfile +import re +from pathlib import Path + + +def extract_dependencies(wheel_path): + """Extract Requires-Dist from wheel METADATA.""" + dependencies = [] + + try: + with zipfile.ZipFile(wheel_path, "r") as whl: + # Find METADATA file + metadata_files = [ + f for f in whl.namelist() if f.endswith(".dist-info/METADATA") + ] + + if not metadata_files: + print(f"Warning: No METADATA found in {wheel_path}", file=sys.stderr) + return dependencies + + metadata_content = whl.read(metadata_files[0]).decode("utf-8") + + # Parse Requires-Dist lines + for line in metadata_content.split("\n"): + line = line.strip() + if line.startswith("Requires-Dist:"): + # Extract dependency specification + dep = line.split(":", 1)[1].strip() + # Remove extras and environment markers + dep = re.split(r"\s*;\s*", dep)[0] + dep = re.split(r"\s*\[", dep)[0] + dependencies.append(dep) + + except Exception as e: + print(f"Error reading {wheel_path}: {e}", file=sys.stderr) + sys.exit(1) + + return dependencies + + +def main(): + if len(sys.argv) != 3: + print("Usage: extract_wheel_deps.py ", file=sys.stderr) + sys.exit(1) + + wheel_dir = Path(sys.argv[1]) + output_file = Path(sys.argv[2]) + + # Find fastsafetensors wheels + wheel_files = list(wheel_dir.glob("fastsafetensors-*.whl")) + + if not wheel_files: + print("Error: No fastsafetensors wheels found", file=sys.stderr) + sys.exit(1) + + # Use first wheel (all should have same dependencies) + wheel_path = wheel_files[0] + print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) + + deps = extract_dependencies(wheel_path) + + # Write dependencies to output file + with open(output_file, "w") as f: + for dep in deps: + f.write(dep + "\n") + + print(f"Extracted {len(deps)} dependencies to {output_file}", file=sys.stderr) + + +if __name__ == "__main__": + main() From 2b12a97cc40ebe690b4c1f0f656d54f2c0accf7e Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 06:01:11 +0000 Subject: [PATCH 39/48] only bundle the dependencies specified in the pyproject.toml Signed-off-by: tjtanaa --- .github/scripts/extract_wheel_deps.py | 111 +++++++++++++++--------- .github/workflows/publish-to-index.yaml | 42 +++++++-- 2 files changed, 107 insertions(+), 46 deletions(-) diff --git a/.github/scripts/extract_wheel_deps.py b/.github/scripts/extract_wheel_deps.py index 79eff27..f44dd94 100644 --- a/.github/scripts/extract_wheel_deps.py +++ b/.github/scripts/extract_wheel_deps.py @@ -1,42 +1,77 @@ #!/usr/bin/env python3 -"""Extract dependencies from wheel METADATA file.""" +"""Extract dependencies from pyproject.toml for a specific version.""" -import sys -import zipfile import re +import sys from pathlib import Path -def extract_dependencies(wheel_path): - """Extract Requires-Dist from wheel METADATA.""" +def parse_pyproject_toml(pyproject_path): + """Parse dependencies from pyproject.toml, excluding test dependencies.""" dependencies = [] try: - with zipfile.ZipFile(wheel_path, "r") as whl: - # Find METADATA file - metadata_files = [ - f for f in whl.namelist() if f.endswith(".dist-info/METADATA") - ] - - if not metadata_files: - print(f"Warning: No METADATA found in {wheel_path}", file=sys.stderr) - return dependencies - - metadata_content = whl.read(metadata_files[0]).decode("utf-8") - - # Parse Requires-Dist lines - for line in metadata_content.split("\n"): - line = line.strip() - if line.startswith("Requires-Dist:"): - # Extract dependency specification - dep = line.split(":", 1)[1].strip() - # Remove extras and environment markers - dep = re.split(r"\s*;\s*", dep)[0] - dep = re.split(r"\s*\[", dep)[0] - dependencies.append(dep) + with open(pyproject_path, "r") as f: + content = f.read() + + # Find [project.dependencies] section + in_dependencies = False + in_optional_dependencies = False + bracket_count = 0 + + for line in content.split("\n"): + line_stripped = line.strip() + + # Check if entering dependencies section + if line_stripped == "[project.dependencies]" or line_stripped.startswith( + "dependencies = [" + ): + in_dependencies = True + if "[" in line: + bracket_count = line.count("[") - line.count("]") + continue + + # Check if entering optional dependencies (skip these) + if ( + "[project.optional-dependencies]" in line_stripped + or "[tool.poetry.group" in line_stripped + ): + in_dependencies = False + in_optional_dependencies = True + continue + + # Exit sections when encountering new section header + if line_stripped.startswith("[") and line_stripped.endswith("]"): + in_dependencies = False + in_optional_dependencies = False + bracket_count = 0 + continue + + # Skip if in optional dependencies + if in_optional_dependencies: + continue + + # Parse dependency lines + if in_dependencies: + # Track bracket balance for multiline arrays + bracket_count += line.count("[") - line.count("]") + + # Extract dependency from quoted string + match = re.search(r'["\']([^"\']+)["\']', line) + if match: + dep = match.group(1).strip() + # Skip comments and empty lines + if dep and not dep.startswith("#"): + # Remove any trailing commas + dep = dep.rstrip(",").strip() + dependencies.append(dep) + + # Check if array is closed + if bracket_count == 0: + in_dependencies = False except Exception as e: - print(f"Error reading {wheel_path}: {e}", file=sys.stderr) + print(f"Error reading {pyproject_path}: {e}", file=sys.stderr) sys.exit(1) return dependencies @@ -44,24 +79,22 @@ def extract_dependencies(wheel_path): def main(): if len(sys.argv) != 3: - print("Usage: extract_wheel_deps.py ", file=sys.stderr) + print( + "Usage: extract_wheel_deps.py ", + file=sys.stderr, + ) sys.exit(1) - wheel_dir = Path(sys.argv[1]) + pyproject_path = Path(sys.argv[1]) output_file = Path(sys.argv[2]) - # Find fastsafetensors wheels - wheel_files = list(wheel_dir.glob("fastsafetensors-*.whl")) - - if not wheel_files: - print("Error: No fastsafetensors wheels found", file=sys.stderr) + if not pyproject_path.exists(): + print(f"Error: {pyproject_path} not found", file=sys.stderr) sys.exit(1) - # Use first wheel (all should have same dependencies) - wheel_path = wheel_files[0] - print(f"Extracting dependencies from: {wheel_path.name}", file=sys.stderr) + print(f"Extracting dependencies from: {pyproject_path}", file=sys.stderr) - deps = extract_dependencies(wheel_path) + deps = parse_pyproject_toml(pyproject_path) # Write dependencies to output file with open(output_file, "w") as f: diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 89192f0..24dd104 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -133,23 +133,51 @@ jobs: cd ../.. fi - - name: Extract dependencies from wheels + - name: Extract dependencies from pyproject.toml run: | PLATFORM="${{ steps.determine.outputs.platform }}" VERSION="${{ steps.determine.outputs.version }}" + # Determine version tag for ROCm/CUDA + get_version_tag() { + local platform=$1 + local version="${VERSION}" + if [[ "${version}" == *"-${platform}"* ]]; then + echo "${version}" + else + echo "${version}-${platform}" + fi + } + extract_deps_for_platform() { local platform=$1 - local wheel_dir="wheels/${platform}" + local version_tag=$(get_version_tag "${platform}") local output_file="wheels/${platform}/requirements.txt" - if [ ! -d "${wheel_dir}" ]; then - echo "No wheels directory for ${platform}" - return + echo "Extracting dependencies for ${platform} from version ${version_tag}..." + + # Checkout the specific version tag to get its pyproject.toml + cd fastsafetensors-rocm + git fetch --tags + + if ! git checkout "${version_tag}" 2>/dev/null; then + echo "Warning: Could not checkout tag ${version_tag}, using current version" + git checkout - + fi + + # Check if pyproject.toml exists + if [ ! -f "pyproject.toml" ]; then + echo "Error: pyproject.toml not found for version ${version_tag}" + cd .. + return 1 fi - echo "Extracting dependencies from ${platform} wheels..." - python3 fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py "${wheel_dir}" "${output_file}" + # Extract dependencies from pyproject.toml + python3 .github/scripts/extract_wheel_deps.py "pyproject.toml" "../${output_file}" + + # Return to original branch/commit + git checkout - + cd .. echo "Extracted dependencies:" cat "${output_file}" From f0ec845fda3098140c46361188bdcd03cdedd8a2 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 06:05:27 +0000 Subject: [PATCH 40/48] bugfix the workflow Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 24dd104..b925025 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -138,6 +138,9 @@ jobs: PLATFORM="${{ steps.determine.outputs.platform }}" VERSION="${{ steps.determine.outputs.version }}" + # Save absolute path to the extraction script (from current checkout) + SCRIPT_PATH="$(pwd)/fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py" + # Determine version tag for ROCm/CUDA get_version_tag() { local platform=$1 @@ -152,7 +155,7 @@ jobs: extract_deps_for_platform() { local platform=$1 local version_tag=$(get_version_tag "${platform}") - local output_file="wheels/${platform}/requirements.txt" + local output_file="$(pwd)/wheels/${platform}/requirements.txt" echo "Extracting dependencies for ${platform} from version ${version_tag}..." @@ -160,23 +163,26 @@ jobs: cd fastsafetensors-rocm git fetch --tags + # Save current commit + local current_ref=$(git rev-parse HEAD) + if ! git checkout "${version_tag}" 2>/dev/null; then echo "Warning: Could not checkout tag ${version_tag}, using current version" - git checkout - fi # Check if pyproject.toml exists if [ ! -f "pyproject.toml" ]; then echo "Error: pyproject.toml not found for version ${version_tag}" + git checkout "${current_ref}" cd .. return 1 fi - # Extract dependencies from pyproject.toml - python3 .github/scripts/extract_wheel_deps.py "pyproject.toml" "../${output_file}" + # Extract dependencies from pyproject.toml using script from current checkout + python3 "${SCRIPT_PATH}" "pyproject.toml" "${output_file}" - # Return to original branch/commit - git checkout - + # Return to original commit + git checkout "${current_ref}" cd .. echo "Extracted dependencies:" From 52910315c7f89feb86b3d7e3ba720a277e91cc8d Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 06:16:25 +0000 Subject: [PATCH 41/48] fixing the publsih to index workflow Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index b925025..a50ec4c 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -138,8 +138,14 @@ jobs: PLATFORM="${{ steps.determine.outputs.platform }}" VERSION="${{ steps.determine.outputs.version }}" - # Save absolute path to the extraction script (from current checkout) - SCRIPT_PATH="$(pwd)/fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py" + # Get absolute paths + WORKSPACE_DIR="$(pwd)" + SCRIPT_PATH="${WORKSPACE_DIR}/fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py" + REPO_DIR="${WORKSPACE_DIR}/fastsafetensors-rocm" + + echo "Workspace: ${WORKSPACE_DIR}" + echo "Script: ${SCRIPT_PATH}" + echo "Repo: ${REPO_DIR}" # Determine version tag for ROCm/CUDA get_version_tag() { @@ -155,12 +161,12 @@ jobs: extract_deps_for_platform() { local platform=$1 local version_tag=$(get_version_tag "${platform}") - local output_file="$(pwd)/wheels/${platform}/requirements.txt" + local output_file="${WORKSPACE_DIR}/wheels/${platform}/requirements.txt" echo "Extracting dependencies for ${platform} from version ${version_tag}..." # Checkout the specific version tag to get its pyproject.toml - cd fastsafetensors-rocm + cd "${REPO_DIR}" git fetch --tags # Save current commit @@ -174,7 +180,7 @@ jobs: if [ ! -f "pyproject.toml" ]; then echo "Error: pyproject.toml not found for version ${version_tag}" git checkout "${current_ref}" - cd .. + cd "${WORKSPACE_DIR}" return 1 fi @@ -183,7 +189,7 @@ jobs: # Return to original commit git checkout "${current_ref}" - cd .. + cd "${WORKSPACE_DIR}" echo "Extracted dependencies:" cat "${output_file}" From 1f2e60c6a1d9a562db115f2c4b7803398db4dd1d Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 06:20:30 +0000 Subject: [PATCH 42/48] fixing the publsih to index workflow Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index a50ec4c..77d0e7d 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -140,11 +140,14 @@ jobs: # Get absolute paths WORKSPACE_DIR="$(pwd)" - SCRIPT_PATH="${WORKSPACE_DIR}/fastsafetensors-rocm/.github/scripts/extract_wheel_deps.py" REPO_DIR="${WORKSPACE_DIR}/fastsafetensors-rocm" + # Copy script to temp location so it survives git checkout + TEMP_SCRIPT="/tmp/extract_wheel_deps_$$.py" + cp "${REPO_DIR}/.github/scripts/extract_wheel_deps.py" "${TEMP_SCRIPT}" + echo "Workspace: ${WORKSPACE_DIR}" - echo "Script: ${SCRIPT_PATH}" + echo "Temp script: ${TEMP_SCRIPT}" echo "Repo: ${REPO_DIR}" # Determine version tag for ROCm/CUDA @@ -184,8 +187,8 @@ jobs: return 1 fi - # Extract dependencies from pyproject.toml using script from current checkout - python3 "${SCRIPT_PATH}" "pyproject.toml" "${output_file}" + # Extract dependencies from pyproject.toml using script from temp location + python3 "${TEMP_SCRIPT}" "pyproject.toml" "${output_file}" # Return to original commit git checkout "${current_ref}" @@ -203,6 +206,9 @@ jobs: extract_deps_for_platform "cuda" fi + # Cleanup temp script + rm -f "${TEMP_SCRIPT}" + - name: Download all dependencies run: | PLATFORM="${{ steps.determine.outputs.platform }}" From bf274a1204d420b583dffc2e47fd72bb13bc96cb Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 06:26:20 +0000 Subject: [PATCH 43/48] update workflow instruction Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 77d0e7d..60d68fc 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -4,17 +4,17 @@ on: workflow_dispatch: inputs: version: - description: 'Version to publish (e.g., v0.1.15-rocm or v0.1.15-cuda)' + description: 'Version to publish (e.g., v0.1.15)' required: true platform: description: 'Platform to publish (rocm, cuda, or both)' required: true - default: 'rocm' + default: 'both' type: choice options: + - both - rocm - cuda - - both release: types: [published] From c5b48868c2bd7cb4cde9b7fef71f1aabf49fd3e6 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Fri, 7 Nov 2025 20:21:01 +0000 Subject: [PATCH 44/48] only allow publish to index be triggered manually Signed-off-by: tjtanaa --- .github/workflows/publish-to-index.yaml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml index 60d68fc..1c5d9fb 100644 --- a/.github/workflows/publish-to-index.yaml +++ b/.github/workflows/publish-to-index.yaml @@ -15,8 +15,6 @@ on: - both - rocm - cuda - release: - types: [published] permissions: contents: write @@ -53,26 +51,11 @@ jobs: - name: Determine platform and version id: determine run: | - # Determine version - if [ "${{ github.event_name }}" = "release" ]; then - VERSION="${{ github.event.release.tag_name }}" - else - VERSION="${{ github.event.inputs.version }}" - fi - echo "version=${VERSION}" >> $GITHUB_OUTPUT + # Get version and platform from workflow inputs + VERSION="${{ github.event.inputs.version }}" + PLATFORM="${{ github.event.inputs.platform }}" - # Determine platform from version tag or input - if [ "${{ github.event_name }}" = "release" ]; then - if [[ "${VERSION}" == *"rocm"* ]]; then - PLATFORM="rocm" - elif [[ "${VERSION}" == *"cuda"* ]]; then - PLATFORM="cuda" - else - PLATFORM="both" - fi - else - PLATFORM="${{ github.event.inputs.platform }}" - fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT echo "platform=${PLATFORM}" >> $GITHUB_OUTPUT echo "Publishing version: ${VERSION}" From d631e44705c40d872204f1d00c83ae60a0bc8dc8 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Mon, 10 Nov 2025 23:31:13 +0000 Subject: [PATCH 45/48] remove github workflow Signed-off-by: tjtanaa --- .github/scripts/extract_wheel_deps.py | 108 ------ .github/workflows/build-rocm-wheels.yaml | 192 ---------- .github/workflows/publish-to-index.yaml | 465 ----------------------- 3 files changed, 765 deletions(-) delete mode 100644 .github/scripts/extract_wheel_deps.py delete mode 100644 .github/workflows/build-rocm-wheels.yaml delete mode 100644 .github/workflows/publish-to-index.yaml diff --git a/.github/scripts/extract_wheel_deps.py b/.github/scripts/extract_wheel_deps.py deleted file mode 100644 index f44dd94..0000000 --- a/.github/scripts/extract_wheel_deps.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python3 -"""Extract dependencies from pyproject.toml for a specific version.""" - -import re -import sys -from pathlib import Path - - -def parse_pyproject_toml(pyproject_path): - """Parse dependencies from pyproject.toml, excluding test dependencies.""" - dependencies = [] - - try: - with open(pyproject_path, "r") as f: - content = f.read() - - # Find [project.dependencies] section - in_dependencies = False - in_optional_dependencies = False - bracket_count = 0 - - for line in content.split("\n"): - line_stripped = line.strip() - - # Check if entering dependencies section - if line_stripped == "[project.dependencies]" or line_stripped.startswith( - "dependencies = [" - ): - in_dependencies = True - if "[" in line: - bracket_count = line.count("[") - line.count("]") - continue - - # Check if entering optional dependencies (skip these) - if ( - "[project.optional-dependencies]" in line_stripped - or "[tool.poetry.group" in line_stripped - ): - in_dependencies = False - in_optional_dependencies = True - continue - - # Exit sections when encountering new section header - if line_stripped.startswith("[") and line_stripped.endswith("]"): - in_dependencies = False - in_optional_dependencies = False - bracket_count = 0 - continue - - # Skip if in optional dependencies - if in_optional_dependencies: - continue - - # Parse dependency lines - if in_dependencies: - # Track bracket balance for multiline arrays - bracket_count += line.count("[") - line.count("]") - - # Extract dependency from quoted string - match = re.search(r'["\']([^"\']+)["\']', line) - if match: - dep = match.group(1).strip() - # Skip comments and empty lines - if dep and not dep.startswith("#"): - # Remove any trailing commas - dep = dep.rstrip(",").strip() - dependencies.append(dep) - - # Check if array is closed - if bracket_count == 0: - in_dependencies = False - - except Exception as e: - print(f"Error reading {pyproject_path}: {e}", file=sys.stderr) - sys.exit(1) - - return dependencies - - -def main(): - if len(sys.argv) != 3: - print( - "Usage: extract_wheel_deps.py ", - file=sys.stderr, - ) - sys.exit(1) - - pyproject_path = Path(sys.argv[1]) - output_file = Path(sys.argv[2]) - - if not pyproject_path.exists(): - print(f"Error: {pyproject_path} not found", file=sys.stderr) - sys.exit(1) - - print(f"Extracting dependencies from: {pyproject_path}", file=sys.stderr) - - deps = parse_pyproject_toml(pyproject_path) - - # Write dependencies to output file - with open(output_file, "w") as f: - for dep in deps: - f.write(dep + "\n") - - print(f"Extracted {len(deps)} dependencies to {output_file}", file=sys.stderr) - - -if __name__ == "__main__": - main() diff --git a/.github/workflows/build-rocm-wheels.yaml b/.github/workflows/build-rocm-wheels.yaml deleted file mode 100644 index 142ee78..0000000 --- a/.github/workflows/build-rocm-wheels.yaml +++ /dev/null @@ -1,192 +0,0 @@ -name: Build ROCm wheels - -on: - workflow_dispatch: - -jobs: - build-rocm-wheels: - name: Build ROCm wheel - Python ${{ matrix.python-version }} - runs-on: ubuntu-latest - container: - image: rocm/dev-ubuntu-24.04:7.0 - options: --user root - strategy: - fail-fast: false - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install system dependencies - run: | - # Prevent interactive prompts during package installation - export DEBIAN_FRONTEND=noninteractive - export TZ=Etc/UTC - - apt-get update - apt-get install -y \ - software-properties-common \ - wget \ - build-essential \ - libnuma-dev \ - gcc \ - g++ \ - make \ - git \ - curl \ - ca-certificates \ - patchelf - - - name: Install Python ${{ matrix.python-version }} - run: | - # Prevent interactive prompts during package installation - export DEBIAN_FRONTEND=noninteractive - export TZ=Etc/UTC - - PY_VER="${{ matrix.python-version }}" - - # Check if Python dev package is available in Ubuntu repos - apt-get update - if apt-cache show python${PY_VER}-dev 2>/dev/null | grep -q "Package: python${PY_VER}-dev"; then - echo "Installing Python ${PY_VER} from Ubuntu repositories" - apt-get install -y \ - python${PY_VER} \ - python${PY_VER}-dev \ - python${PY_VER}-venv - else - # If not available in Ubuntu repos, install using pyenv - echo "Python ${PY_VER} not in Ubuntu repos, installing via pyenv from python.org" - - # Install pyenv dependencies - apt-get install -y \ - libssl-dev \ - zlib1g-dev \ - libbz2-dev \ - libreadline-dev \ - libsqlite3-dev \ - libncursesw5-dev \ - xz-utils \ - tk-dev \ - libxml2-dev \ - libxmlsec1-dev \ - libffi-dev \ - liblzma-dev - - # Install pyenv - export PYENV_ROOT="/root/.pyenv" - curl https://pyenv.run | bash - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - - # Install Python from official python.org releases - pyenv install ${PY_VER} - pyenv global ${PY_VER} - - # Create symlink so python${PY_VER} command works - INSTALLED_VERSION=$(ls /root/.pyenv/versions/ | grep "^${PY_VER}") - ln -sf /root/.pyenv/versions/${INSTALLED_VERSION}/bin/python /usr/local/bin/python${PY_VER} - echo "Created symlink: /usr/local/bin/python${PY_VER} -> /root/.pyenv/versions/${INSTALLED_VERSION}/bin/python" - fi - - # Verify installation - python${PY_VER} --version - - - name: Create virtual environment and install build dependencies - run: | - PY_VER="${{ matrix.python-version }}" - - # Create virtual environment - python${PY_VER} -m venv /opt/venv - - # Activate venv and install dependencies - . /opt/venv/bin/activate - - # Upgrade pip and install build tools - python -m pip install --upgrade pip setuptools wheel - python -m pip install build setuptools_scm pybind11 numpy auditwheel - - # Verify - python --version - pip --version - - - name: Set ROCm environment variables - run: | - echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV - echo "HIP_PATH=/opt/rocm/hip" >> $GITHUB_ENV - echo "/opt/rocm/bin" >> $GITHUB_PATH - echo "/opt/rocm/hip/bin" >> $GITHUB_PATH - echo "/opt/venv/bin" >> $GITHUB_PATH - - # Verify ROCm installation - ls -la /opt/rocm/ || echo "Warning: /opt/rocm not found" - hipify-perl --version || echo "Warning: hipify-perl not working" - - - name: Build wheel for ROCm - run: | - # Activate venv - . /opt/venv/bin/activate - - # The setup.py should detect ROCm and use hipify-perl automatically - python -m pip wheel . -w wheelhouse/ --no-deps -v - env: - ROCM_PATH: /opt/rocm - HIP_PATH: /opt/rocm/hip - - - name: List built wheels - run: | - ls -lah wheelhouse/ - - - name: Repair wheel with auditwheel to create manylinux wheel - run: | - # Activate venv - . /opt/venv/bin/activate - - # Use auditwheel to repair and convert to manylinux wheel - mkdir -p wheelhouse_repaired - for wheel in wheelhouse/*.whl; do - echo "Repairing wheel: $wheel" - auditwheel repair "$wheel" -w wheelhouse_repaired/ || { - echo "auditwheel repair failed, copying original wheel" - cp "$wheel" wheelhouse_repaired/ - } - done - - # Replace original wheelhouse with repaired wheels - rm -rf wheelhouse - mv wheelhouse_repaired wheelhouse - - echo "Repaired wheels:" - ls -lah wheelhouse/ - - - name: Upload wheel artifact - uses: actions/upload-artifact@v4 - with: - name: rocm-wheel-py${{ matrix.python-version }} - path: wheelhouse/*.whl - if-no-files-found: error - - collect-wheels: - name: Collect all ROCm wheels - needs: build-rocm-wheels - runs-on: ubuntu-latest - - steps: - - name: Download all wheel artifacts - uses: actions/download-artifact@v4 - with: - path: all-wheels/ - pattern: rocm-wheel-* - merge-multiple: true - - - name: List all wheels - run: | - echo "Built ROCm wheels:" - ls -lah all-wheels/ - - - name: Upload combined artifact - uses: actions/upload-artifact@v4 - with: - name: rocm-wheels-all - path: all-wheels/*.whl diff --git a/.github/workflows/publish-to-index.yaml b/.github/workflows/publish-to-index.yaml deleted file mode 100644 index 1c5d9fb..0000000 --- a/.github/workflows/publish-to-index.yaml +++ /dev/null @@ -1,465 +0,0 @@ -name: Publish wheels to custom index - -on: - workflow_dispatch: - inputs: - version: - description: 'Version to publish (e.g., v0.1.15)' - required: true - platform: - description: 'Platform to publish (rocm, cuda, or both)' - required: true - default: 'both' - type: choice - options: - - both - - rocm - - cuda - -permissions: - contents: write - -jobs: - publish-to-github-pages: - name: Publish to GitHub Pages index - runs-on: ubuntu-latest - - steps: - - name: Checkout fastsafetensors-rocm repo - uses: actions/checkout@v4 - with: - path: fastsafetensors-rocm - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install tools - run: | - python -m pip install --upgrade pip - pip install dumb-pypi - - # Install GitHub CLI - type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ - && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && sudo apt update \ - && sudo apt install gh -y - - - name: Determine platform and version - id: determine - run: | - # Get version and platform from workflow inputs - VERSION="${{ github.event.inputs.version }}" - PLATFORM="${{ github.event.inputs.platform }}" - - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "platform=${PLATFORM}" >> $GITHUB_OUTPUT - - echo "Publishing version: ${VERSION}" - echo "Platform: ${PLATFORM}" - - - name: Download wheels from release - env: - GH_TOKEN: ${{ github.token }} - run: | - VERSION="${{ steps.determine.outputs.version }}" - PLATFORM="${{ steps.determine.outputs.platform }}" - - # Function to construct platform-specific version tag - get_version_tag() { - local platform=$1 - local version="${VERSION}" - - # If version already has platform suffix, use as-is - if [[ "${version}" == *"-${platform}"* ]]; then - echo "${version}" - else - # Otherwise append platform suffix - echo "${version}-${platform}" - fi - } - - # Download ROCm wheels - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - ROCM_VERSION=$(get_version_tag "rocm") - mkdir -p wheels/rocm - echo "Downloading ROCm wheels from release ${ROCM_VERSION}" - cd wheels/rocm - if ! gh release download "${ROCM_VERSION}" \ - --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl"; then - echo "ERROR: Failed to download ROCm wheels from ${ROCM_VERSION}" - exit 1 - fi - echo "Downloaded wheels:" - ls -lah - cd ../.. - fi - - # Download CUDA wheels - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - CUDA_VERSION=$(get_version_tag "cuda") - mkdir -p wheels/cuda - echo "Downloading CUDA wheels from release ${CUDA_VERSION}" - cd wheels/cuda - if ! gh release download "${CUDA_VERSION}" \ - --repo EmbeddedLLM/fastsafetensors-rocm \ - --pattern "*.whl"; then - echo "ERROR: Failed to download CUDA wheels from ${CUDA_VERSION}" - exit 1 - fi - echo "Downloaded wheels:" - ls -lah - cd ../.. - fi - - - name: Extract dependencies from pyproject.toml - run: | - PLATFORM="${{ steps.determine.outputs.platform }}" - VERSION="${{ steps.determine.outputs.version }}" - - # Get absolute paths - WORKSPACE_DIR="$(pwd)" - REPO_DIR="${WORKSPACE_DIR}/fastsafetensors-rocm" - - # Copy script to temp location so it survives git checkout - TEMP_SCRIPT="/tmp/extract_wheel_deps_$$.py" - cp "${REPO_DIR}/.github/scripts/extract_wheel_deps.py" "${TEMP_SCRIPT}" - - echo "Workspace: ${WORKSPACE_DIR}" - echo "Temp script: ${TEMP_SCRIPT}" - echo "Repo: ${REPO_DIR}" - - # Determine version tag for ROCm/CUDA - get_version_tag() { - local platform=$1 - local version="${VERSION}" - if [[ "${version}" == *"-${platform}"* ]]; then - echo "${version}" - else - echo "${version}-${platform}" - fi - } - - extract_deps_for_platform() { - local platform=$1 - local version_tag=$(get_version_tag "${platform}") - local output_file="${WORKSPACE_DIR}/wheels/${platform}/requirements.txt" - - echo "Extracting dependencies for ${platform} from version ${version_tag}..." - - # Checkout the specific version tag to get its pyproject.toml - cd "${REPO_DIR}" - git fetch --tags - - # Save current commit - local current_ref=$(git rev-parse HEAD) - - if ! git checkout "${version_tag}" 2>/dev/null; then - echo "Warning: Could not checkout tag ${version_tag}, using current version" - fi - - # Check if pyproject.toml exists - if [ ! -f "pyproject.toml" ]; then - echo "Error: pyproject.toml not found for version ${version_tag}" - git checkout "${current_ref}" - cd "${WORKSPACE_DIR}" - return 1 - fi - - # Extract dependencies from pyproject.toml using script from temp location - python3 "${TEMP_SCRIPT}" "pyproject.toml" "${output_file}" - - # Return to original commit - git checkout "${current_ref}" - cd "${WORKSPACE_DIR}" - - echo "Extracted dependencies:" - cat "${output_file}" - } - - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - extract_deps_for_platform "rocm" - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - extract_deps_for_platform "cuda" - fi - - # Cleanup temp script - rm -f "${TEMP_SCRIPT}" - - - name: Download all dependencies - run: | - PLATFORM="${{ steps.determine.outputs.platform }}" - - # Function to download dependencies for a platform - download_deps() { - local platform=$1 - local dest_dir="wheels/${platform}" - local req_file="${dest_dir}/requirements.txt" - - echo "Downloading dependencies for ${platform}..." - - if [ ! -f "${req_file}" ]; then - echo "No requirements file found for ${platform}, skipping" - return - fi - - # For each Python version, download dependencies - for py_ver in 3.9 3.10 3.11 3.12 3.13; do - echo "Downloading dependencies for Python ${py_ver}" - - # Download dependencies using extracted requirements - python -m pip download \ - --dest "${dest_dir}" \ - --only-binary :all: \ - --python-version ${py_ver} \ - --platform manylinux2014_x86_64 \ - --platform manylinux_2_17_x86_64 \ - --platform manylinux_2_27_x86_64 \ - --platform manylinux_2_28_x86_64 \ - -r "${req_file}" 2>/dev/null || echo "Some downloads failed for Python ${py_ver}" - done - - # Also download using current Python for any missing wheels - python -m pip download \ - --dest "${dest_dir}" \ - --only-binary :all: \ - -r "${req_file}" || true - - # Summary - if [ -d "${dest_dir}" ] && [ "$(ls -A ${dest_dir}/*.whl 2>/dev/null)" ]; then - echo "Total wheels collected for ${platform}:" - ls -1 "${dest_dir}"/*.whl | wc -l - - echo "Wheel breakdown by package:" - ls -1 "${dest_dir}"/*.whl | xargs -n1 basename | sed 's/-[0-9].*//' | sort | uniq -c - fi - } - - # Download for requested platforms - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - download_deps "rocm" - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - download_deps "cuda" - fi - - - name: Checkout GitHub Pages repository - uses: actions/checkout@v4 - with: - repository: EmbeddedLLM/fastsafetensors-rocm - ref: gh-pages - token: ${{ secrets.GITHUB_TOKEN }} - path: gh-pages-repo - - - name: Copy wheels and generate index - run: | - cd gh-pages-repo - PLATFORM="${{ steps.determine.outputs.platform }}" - VERSION="${{ steps.determine.outputs.version }}" - - # Function to generate index for a platform - generate_index() { - local platform=$1 - local version="${VERSION}" - - echo "Generating index for ${platform}..." - - # Clean up old index files to avoid conflicts - rm -rf "${platform}/simple" - rm -f "${platform}/package-list.txt" - rm -f "${platform}/index.html" - rm -f "${platform}/packages.json" - - # Create directory structure - mkdir -p "${platform}/packages" - mkdir -p "${platform}/manifests" - - # Copy all wheels - if [ -d "../wheels/${platform}" ] && [ "$(ls -A ../wheels/${platform}/*.whl 2>/dev/null)" ]; then - # Extract version number (remove 'v' prefix if present) - local clean_version="${version#v}" - - # Remove OLD wheels for the SAME version only - echo "Removing old fastsafetensors-${clean_version} wheels..." - rm -f "${platform}/packages/fastsafetensors-${clean_version}"-*.whl || true - - # Copy new wheels - echo "Copying new wheels..." - cp ../wheels/${platform}/*.whl "${platform}/packages/" - - # Generate package list with just filenames (dumb-pypi doesn't accept paths with /) - (cd "${platform}/packages" && ls *.whl) > "${platform}/package-list.txt" - - echo "Package list contents:" - cat "${platform}/package-list.txt" - - # Create manifest for this version - echo "Creating manifest for version ${clean_version}..." - local manifest_file="${platform}/manifests/v${clean_version}.json" - - # Read dependencies from requirements.txt - local deps_json="[]" - if [ -f "../wheels/${platform}/requirements.txt" ]; then - deps_json=$(python3 -c 'import json,sys; print(json.dumps([line.strip() for line in open("../wheels/'${platform}'/requirements.txt") if line.strip() and not line.startswith("#")]))') - fi - - # List fastsafetensors wheels - local fst_wheels_json=$(cd "${platform}/packages" && python3 -c 'import json,glob; print(json.dumps(sorted(glob.glob("fastsafetensors-'${clean_version}'-*.whl"))))') - - # List all downloaded wheels - local all_wheels_json=$(cd "${platform}/packages" && python3 -c 'import json,glob; print(json.dumps(sorted(glob.glob("*.whl"))))') - - # Create manifest JSON using Python - python3 -c "import json,sys; manifest={'fastsafetensors_version':'${clean_version}','published_at':'$(date -u +%Y-%m-%dT%H:%M:%SZ)','platform':'${platform}','dependencies':${deps_json},'fastsafetensors_wheels':${fst_wheels_json},'total_wheels_in_index':len(${all_wheels_json})}; json.dump(manifest,open('${manifest_file}','w'),indent=2)" - - echo "Created manifest:" - cat "${manifest_file}" - - # Generate PEP 503 compliant index - # Note: dumb-pypi expects wheel files to be accessible from where it runs - # Run from packages/ directory so dumb-pypi can find the wheels by filename - # packages-url is relative from simple/fastsafetensors/ to packages/: ../../packages - (cd "${platform}/packages" && \ - dumb-pypi \ - --package-list ../package-list.txt \ - --packages-url ../../packages \ - --output-dir .. \ - --title "fastsafetensors ${platform^^} Index") - - echo "Generated ${platform} index for $(ls ${platform}/packages/*.whl | wc -l) wheels" - - # Debug: show generated structure - echo "Generated structure:" - ls -la "${platform}/simple/" || echo "No simple/ directory created" - ls -la "${platform}/simple/fastsafetensors/" || echo "No fastsafetensors/ directory created" - else - echo "No wheels found for ${platform}, skipping index generation" - fi - } - - # Generate for requested platforms - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - generate_index "rocm" - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - generate_index "cuda" - fi - - - name: Create index READMEs - run: | - cd gh-pages-repo - PLATFORM="${{ steps.determine.outputs.platform }}" - - # Function to create README for a platform - create_readme() { - local platform=$1 - local platform_upper=$(echo $platform | tr '[:lower:]' '[:upper:]') - - if [ ! -d "${platform}/packages" ] || [ ! "$(ls -A ${platform}/packages/*.whl 2>/dev/null)" ]; then - echo "No packages for ${platform}, skipping README" - return - fi - - cat > "${platform}/README.md" << EOF - # fastsafetensors ${platform_upper} Package Index - - This is a custom Python package index for ${platform_upper}-built fastsafetensors wheels. - - ## Installation - - \`\`\`bash - # Install fastsafetensors with ${platform_upper} support - pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/${platform}/simple/ - \`\`\` - - ## Available Packages - - This index includes: - - \`fastsafetensors\` - ${platform_upper} builds for Python 3.9-3.13 - - All dependencies (typer, click, etc.) for multiple Python versions and platforms - - ## What's Included - - EOF - - # List packages with counts - echo "### Package Inventory" >> "${platform}/README.md" - echo "" >> "${platform}/README.md" - ls "${platform}/packages"/*.whl | sed 's/.*\///' | sed 's/-[0-9].*//' | sort | uniq -c | awk '{print "- " $2 ": " $1 " wheels"}' >> "${platform}/README.md" - } - - # Create READMEs for requested platforms - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - create_readme "rocm" - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - create_readme "cuda" - fi - - - name: Commit and push to gh-pages - run: | - cd gh-pages-repo - PLATFORM="${{ steps.determine.outputs.platform }}" - - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - - # Add platform directories based on selection - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - git add rocm/ - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - git add cuda/ - fi - - if git diff --staged --quiet; then - echo "No changes to commit" - else - if [ "$PLATFORM" = "both" ]; then - git commit -m "Update ROCm and CUDA indices - $(date +%Y-%m-%d)" - elif [ "$PLATFORM" = "cuda" ]; then - git commit -m "Update CUDA index - $(date +%Y-%m-%d)" - else - git commit -m "Update ROCm index - $(date +%Y-%m-%d)" - fi - git push - echo "Successfully pushed to gh-pages branch" - fi - - - name: Summary - run: | - PLATFORM="${{ steps.determine.outputs.platform }}" - - echo "## Published to GitHub Pages! 🎉" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - if [ "$PLATFORM" = "rocm" ] || [ "$PLATFORM" = "both" ]; then - echo "### ROCm Index" >> $GITHUB_STEP_SUMMARY - echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Installation:**" >> $GITHUB_STEP_SUMMARY - echo '```bash' >> $GITHUB_STEP_SUMMARY - echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/rocm/simple/" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - fi - - if [ "$PLATFORM" = "cuda" ] || [ "$PLATFORM" = "both" ]; then - echo "### CUDA Index" >> $GITHUB_STEP_SUMMARY - echo "Index URL: https://embeddedllm.github.io/fastsafetensors-rocm/cuda/simple/" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Installation:**" >> $GITHUB_STEP_SUMMARY - echo '```bash' >> $GITHUB_STEP_SUMMARY - echo "pip install fastsafetensors --index-url https://embeddedllm.github.io/fastsafetensors-rocm/cuda/simple/" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - fi From e353538e433673fc1380de4477e718f700dc3c6a Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Mon, 10 Nov 2025 23:55:51 +0000 Subject: [PATCH 46/48] update installation procedure on ROCm Signed-off-by: tjtanaa --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c692e10..e50d967 100644 --- a/README.md +++ b/README.md @@ -66,11 +66,17 @@ pip install . ## For ROCm -### Install from source - On ROCm, there are not GDS equivalent support. So fastsafetensors support only supports `nogds=True` mode. The performance gain example can be found at [amd-perf.md](./docs/amd-perf.md) +### Install from Github Source + ```bash -python3 setup.py develop +python3 -m pip install git+https://github.com/foundation-model-stack/fastsafetensors.git +``` + +### Install from source + +```bash +pip install . ``` From 8fd8b99c04b939edf02ae98844e6b1a5e832dd80 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Mon, 10 Nov 2025 23:56:23 +0000 Subject: [PATCH 47/48] fix installation command Signed-off-by: tjtanaa --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e50d967..4d58823 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ The performance gain example can be found at [amd-perf.md](./docs/amd-perf.md) ### Install from Github Source ```bash -python3 -m pip install git+https://github.com/foundation-model-stack/fastsafetensors.git +pip install git+https://github.com/foundation-model-stack/fastsafetensors.git ``` ### Install from source From 82fba39009f96d5469a38d79f15f866e7fe99d09 Mon Sep 17 00:00:00 2001 From: tjtanaa Date: Tue, 11 Nov 2025 06:48:36 +0000 Subject: [PATCH 48/48] fix enum for HIP Signed-off-by: tjtanaa --- fastsafetensors/cpp/ext.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fastsafetensors/cpp/ext.hpp b/fastsafetensors/cpp/ext.hpp index 961011f..770d3a1 100644 --- a/fastsafetensors/cpp/ext.hpp +++ b/fastsafetensors/cpp/ext.hpp @@ -39,7 +39,12 @@ typedef struct CUfileError { CUfileOpError err; } CUfileError_t; // Define minimal CUDA/HIP types for both platforms to avoid compile-time dependencies // We load all GPU functions dynamically at runtime via dlopen() typedef enum cudaError { cudaSuccess = 0, cudaErrorMemoryAllocation = 2 } cudaError_t; +// Platform-specific enum values - CUDA and HIP have different values for HostToDevice +#ifdef USE_ROCM +enum cudaMemcpyKind { cudaMemcpyHostToDevice=1, cudaMemcpyDefault = 4 }; +#else enum cudaMemcpyKind { cudaMemcpyHostToDevice=2, cudaMemcpyDefault = 4 }; +#endif typedef enum CUfileFeatureFlags {