more at: huggingface/safetensors#676
Last active
December 12, 2025 17:06
-
-
Save maifeeulasad/741df3cf99a9970ce7a4897d5583b223 to your computer and use it in GitHub Desktop.
safetensors-benchmarking.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[],"dockerImageVersionId":31193,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!git clone https://github.com/maifeeulasad/safetensors.git && cd safetensors && git checkout nvidia-gds-support-maifee","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:02:37.779717Z","iopub.execute_input":"2025-12-12T17:02:37.779929Z","iopub.status.idle":"2025-12-12T17:02:39.123412Z","shell.execute_reply.started":"2025-12-12T17:02:37.779907Z","shell.execute_reply":"2025-12-12T17:02:39.122396Z"}},"outputs":[{"name":"stdout","text":"Cloning into 'safetensors'...\nremote: Enumerating objects: 6314, done.\u001b[K\nremote: Counting objects: 100% (190/190), done.\u001b[K\nremote: Compressing objects: 100% (98/98), done.\u001b[K\nremote: Total 6314 (delta 111), reused 127 (delta 76), pack-reused 6124 (from 4)\u001b[K\nReceiving objects: 100% (6314/6314), 2.41 MiB | 19.60 MiB/s, done.\nResolving deltas: 100% (3039/3039), done.\nBranch 'nvidia-gds-support-maifee' set up to track remote branch 'nvidia-gds-support-maifee' from 'origin'.\nSwitched to a new branch 'nvidia-gds-support-maifee'\n","output_type":"stream"}],"execution_count":1},{"cell_type":"code","source":"!ldconfig -p | grep -i cufile","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:02:39.125643Z","iopub.execute_input":"2025-12-12T17:02:39.126132Z","iopub.status.idle":"2025-12-12T17:02:39.263229Z","shell.execute_reply.started":"2025-12-12T17:02:39.126098Z","shell.execute_reply":"2025-12-12T17:02:39.262501Z"}},"outputs":[{"name":"stdout","text":"\tlibcufile_rdma.so.1 (libc6,x86-64) => /usr/local/cuda/targets/x86_64-linux/lib/libcufile_rdma.so.1\n\tlibcufile_rdma.so (libc6,x86-64) => /usr/local/cuda/targets/x86_64-linux/lib/libcufile_rdma.so\n\tlibcufile.so.0 (libc6,x86-64) => /usr/local/cuda/targets/x86_64-linux/lib/libcufile.so.0\n\tlibcufile.so (libc6,x86-64) => /usr/local/cuda/targets/x86_64-linux/lib/libcufile.so\n","output_type":"stream"}],"execution_count":2},{"cell_type":"code","source":"!python3 -m pip show safetensors","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:02:39.264292Z","iopub.execute_input":"2025-12-12T17:02:39.264592Z","iopub.status.idle":"2025-12-12T17:02:42.218367Z","shell.execute_reply.started":"2025-12-12T17:02:39.264559Z","shell.execute_reply":"2025-12-12T17:02:42.217494Z"}},"outputs":[{"name":"stdout","text":"Name: safetensors\nVersion: 0.5.3\nSummary: \nHome-page: https://github.com/huggingface/safetensors\nAuthor: \nAuthor-email: Nicolas Patry <[email protected]>\nLicense: \nLocation: /usr/local/lib/python3.11/dist-packages\nRequires: \nRequired-by: accelerate, diffusers, peft, timm, torchtune, transformers\n","output_type":"stream"}],"execution_count":3},{"cell_type":"code","source":"!python3 -m pip uninstall -y safetensors --break-system-packages && python3 -m pip show safetensors","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:02:42.219614Z","iopub.execute_input":"2025-12-12T17:02:42.220297Z","iopub.status.idle":"2025-12-12T17:02:44.515115Z","shell.execute_reply.started":"2025-12-12T17:02:42.220260Z","shell.execute_reply":"2025-12-12T17:02:44.514272Z"}},"outputs":[{"name":"stdout","text":"Found existing installation: safetensors 0.5.3\nUninstalling safetensors-0.5.3:\n Successfully uninstalled safetensors-0.5.3\n\u001b[33mWARNING: Package(s) not found: safetensors\u001b[0m\u001b[33m\n\u001b[0m","output_type":"stream"}],"execution_count":4},{"cell_type":"code","source":"!apt install curl -y\n!curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n!bash -lc \"source $HOME/.cargo/env && cargo --version\"\n!python3 -m pip install maturin patchelf --break-system-packages","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:02:44.516186Z","iopub.execute_input":"2025-12-12T17:02:44.516395Z","iopub.status.idle":"2025-12-12T17:03:14.489408Z","shell.execute_reply.started":"2025-12-12T17:02:44.516374Z","shell.execute_reply":"2025-12-12T17:03:14.488486Z"}},"outputs":[{"name":"stdout","text":"Reading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nThe following additional packages will be installed:\n libcurl4 libcurl4-openssl-dev\nSuggested packages:\n libcurl4-doc libidn11-dev libldap2-dev librtmp-dev\nThe following packages will be upgraded:\n curl libcurl4 libcurl4-openssl-dev\n3 upgraded, 0 newly installed, 0 to remove and 162 not upgraded.\nNeed to get 870 kB of archives.\nAfter this operation, 0 B of additional disk space will be used.\nGet:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcurl4-openssl-dev amd64 7.81.0-1ubuntu1.21 [386 kB]\nGet:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 curl amd64 7.81.0-1ubuntu1.21 [194 kB]\nGet:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcurl4 amd64 7.81.0-1ubuntu1.21 [290 kB]\nFetched 870 kB in 1s (1,436 kB/s) \u001b[0m\u001b[33m\n\n(Reading database ... 128639 files and directories currently installed.)\nPreparing to unpack .../libcurl4-openssl-dev_7.81.0-1ubuntu1.21_amd64.deb ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 0%]\u001b[49m\u001b[39m [..........................................................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 8%]\u001b[49m\u001b[39m [####......................................................] \u001b8Unpacking libcurl4-openssl-dev:amd64 (7.81.0-1ubuntu1.21) over (7.81.0-1ubuntu1.20) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 15%]\u001b[49m\u001b[39m [########..................................................] \u001b8Preparing to unpack .../curl_7.81.0-1ubuntu1.21_amd64.deb ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 23%]\u001b[49m\u001b[39m [#############.............................................] \u001b8Unpacking curl (7.81.0-1ubuntu1.21) over (7.81.0-1ubuntu1.20) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 31%]\u001b[49m\u001b[39m [#################.........................................] \u001b8Preparing to unpack .../libcurl4_7.81.0-1ubuntu1.21_amd64.deb ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 38%]\u001b[49m\u001b[39m [######################....................................] \u001b8Unpacking libcurl4:amd64 (7.81.0-1ubuntu1.21) over (7.81.0-1ubuntu1.20) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 46%]\u001b[49m\u001b[39m [##########################................................] \u001b8Setting up libcurl4:amd64 (7.81.0-1ubuntu1.21) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 54%]\u001b[49m\u001b[39m [###############################...........................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 62%]\u001b[49m\u001b[39m [###################################.......................] \u001b8Setting up curl (7.81.0-1ubuntu1.21) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 69%]\u001b[49m\u001b[39m [########################################..................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 77%]\u001b[49m\u001b[39m [############################################..............] \u001b8Setting up libcurl4-openssl-dev:amd64 (7.81.0-1ubuntu1.21) ...\n\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 85%]\u001b[49m\u001b[39m [#################################################.........] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 92%]\u001b[49m\u001b[39m [#####################################################.....] \u001b8Processing triggers for man-db (2.10.2-1) ...\nProcessing triggers for libc-bin (2.35-0ubuntu3.8) ...\n/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n\n/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n\n\n\u001b7\u001b[0;24r\u001b8\u001b[1A\u001b[J\u001b[1minfo:\u001b[0m downloading installer\n\u001b[0m\u001b[1minfo: \u001b[0mprofile set to 'default'\n\u001b[0m\u001b[1minfo: \u001b[0mdefault host triple is x86_64-unknown-linux-gnu\n\u001b[0m\u001b[1minfo: \u001b[0msyncing channel updates for 'stable-x86_64-unknown-linux-gnu'\n\u001b[0m\u001b[1minfo: \u001b[0mlatest update on 2025-12-11, rust version 1.92.0 (ded5c06cf 2025-12-08)\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'cargo'\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'clippy'\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'rust-docs'\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'rust-std'\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'rustc'\n\u001b[0m\u001b[1minfo: \u001b[0mdownloading component 'rustfmt'\n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'cargo'\n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'clippy'\n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'rust-docs'\n 20.5 MiB / 20.5 MiB (100 %) 7.1 MiB/s in 2s \n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'rust-std'\n 28.0 MiB / 28.0 MiB (100 %) 10.9 MiB/s in 2s \n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'rustc'\n 74.3 MiB / 74.3 MiB (100 %) 11.6 MiB/s in 6s \n\u001b[0m\u001b[1minfo: \u001b[0minstalling component 'rustfmt'\n\u001b[0m\u001b[1minfo: \u001b[0mdefault toolchain set to 'stable-x86_64-unknown-linux-gnu'\n\n \u001b[0m\u001b[1m\u001b[0m\u001b[1m\u001b[32mstable-x86_64-unknown-linux-gnu installed\u001b[0m - rustc 1.92.0 (ded5c06cf 2025-12-08)\n\n\u001b[0m\u001b[1m\nRust is installed now. Great!\n\u001b[0m\nTo get started you may need to restart your current shell.\nThis would reload your \u001b[0m\u001b[1mPATH\u001b[0m environment variable to include\nCargo's bin directory ($HOME/.cargo/bin).\n\nTo configure your current shell, you need to source\nthe corresponding \u001b[0m\u001b[1menv\u001b[0m file under $HOME/.cargo.\n\nThis is usually done by running one of the following (note the leading DOT):\n. \"$HOME/.cargo/env\" # For sh/bash/zsh/ash/dash/pdksh\nsource \"$HOME/.cargo/env.fish\" # For fish\nsource $\"($nu.home-path)/.cargo/env.nu\" # For nushell\ncargo 1.92.0 (344c4567c 2025-10-21)\nCollecting maturin\n Downloading maturin-1.10.2-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl.metadata (16 kB)\nCollecting patchelf\n Downloading patchelf-0.17.2.4-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.musllinux_1_1_x86_64.whl.metadata (3.7 kB)\nDownloading maturin-1.10.2-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl (9.2 MB)\n\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.2/9.2 MB\u001b[0m \u001b[31m89.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n\u001b[?25hDownloading patchelf-0.17.2.4-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.musllinux_1_1_x86_64.whl (482 kB)\n\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m482.8/482.8 kB\u001b[0m \u001b[31m33.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hInstalling collected packages: patchelf, maturin\nSuccessfully installed maturin-1.10.2 patchelf-0.17.2.4\n","output_type":"stream"}],"execution_count":5},{"cell_type":"code","source":"!bash -lc \"source $HOME/.cargo/env && cd safetensors/bindings/python/ && maturin build --release && python3 -m pip install target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl --break-system-packages --force-reinstall\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:14.490556Z","iopub.execute_input":"2025-12-12T17:03:14.490880Z","iopub.status.idle":"2025-12-12T17:03:38.493637Z","shell.execute_reply.started":"2025-12-12T17:03:14.490853Z","shell.execute_reply":"2025-12-12T17:03:38.492750Z"}},"outputs":[{"name":"stdout","text":"\u001b[1m\u001b[92m Updating\u001b[0m crates.io index\n\u001b[1m\u001b[92m Locking\u001b[0m 32 packages to latest compatible versions\n\u001b[1m\u001b[92m Adding\u001b[0m pyo3 v0.25.1 \u001b[1m\u001b[33m(available: v0.27.2)\u001b[0m\n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m equivalent v1.0.2 \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m itoa v1.0.15ining bytes: 978.5KiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m autocfg v1.5.0ing bytes: 946.6KiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m unindent v0.2.4ng bytes: 946.6KiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m foldhash v0.2.0ng bytes: 3.0MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m rustversion v1.0.22ytes: 3.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m indoc v2.0.7ining bytes: 3.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m target-lexicon v0.13.3s: 2.9MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m unicode-ident v1.0.22es: 2.6MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m serde_derive v1.0.228es: 2.4MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m serde v1.0.228ing bytes: 2.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m pyo3-ffi v0.25.1g bytes: 2.0MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m memchr v2.7.6ning bytes: 1.8MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m hashbrown v0.16.1 bytes: 1.8MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m serde_json v1.0.145ytes: 1.7MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m proc-macro2 v1.0.103tes: 1.6MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m portable-atomic v1.11.1: 1.5MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m serde_core v1.0.228ytes: 1.4MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m pyo3-macros-backend v0.25.14MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m memmap2 v0.9.9ing bytes: 1.4MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m ryu v1.0.20aining bytes: 1.3MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m syn v2.0.111ining bytes: 1.2MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m quote v1.0.42ing bytes: 1.2MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m pyo3-macros v0.25.1tes: 1.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m pyo3-build-config v0.25.1.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m once_cell v1.21.3bytes: 1.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m memoffset v0.9.1 bytes: 1.1MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m heck v0.5.0ining bytes: 1.0MiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m allocator-api2 v0.2.21: 1013.2KiB \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m libc v0.2.178 \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m pyo3 v0.25.1ting libc ... \n\u001b[K\u001b[1m\u001b[92m Downloaded\u001b[0m 31 crates (3.5MiB) in 0.29s (largest was `pyo3` at 1.1MiB) \n🍹 Building a mixed python/rust project\n🔗 Found pyo3 bindings with abi3 support\n🐍 Found CPython 3.11 at /usr/bin/python3\n📡 Using build options features, bindings from pyproject.toml\n\u001b[1m\u001b[92m Compiling\u001b[0m target-lexicon v0.13.3\n\u001b[1m\u001b[92m Compiling\u001b[0m once_cell v1.21.3\n\u001b[1m\u001b[92m Compiling\u001b[0m proc-macro2 v1.0.103\n\u001b[1m\u001b[92m Compiling\u001b[0m quote v1.0.42\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m unicode-ident v1.0.22 ] 0/58: once_cell, proc-macro2(buil…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m serde_core v1.0.228 ] 2/58: proc-macro2(build.rs), quot…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m libc v0.2.178 ] 4/58: serde_core(build.rs), targe…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m autocfg v1.5.0 ] 11/58: libc(build), target-lexicon…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-build-config v0.25.1 ] 12/58: target-lexicon, autocfg, se…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m memoffset v0.9.1 ] 14/58: quote, pyo3-build-config(bu…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m syn v2.0.111 ] 15/58: memoffset(build.rs), quote,…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m heck v0.5.0 ] 19/58: syn, libc, pyo3-build-confi…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-ffi v0.25.1 ] 20/58: syn, pyo3-build-config, ser…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-macros-backend v0.25.1 ] 21/58: pyo3-ffi(build.rs), syn, se…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m serde_json v1.0.145 ] 23/58: syn, pyo3-macros-backend(bu…py…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m serde v1.0.228 ] 25/58: pyo3-macros-backend(build),…bu…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3 v0.25.1> ] 27/58: serde_json(build), syn, ser…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m equivalent v1.0.2 ] 30/58: memoffset(build), syn, serd…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m ryu v1.0.20> ] 31/58: memoffset(build), equivalen…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m itoa v1.0.15==> ] 32/58: ryu, equivalent, syn, serde…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m allocator-api2 v0.2.21 ] 33/58: ryu, syn, serde_core, itoa \n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m foldhash v0.2.0> ] 34/58: ryu, syn, allocator-api2, s…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m memchr v2.7.6===> ] 35/58: syn, allocator-api2, foldha…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m hashbrown v0.16.1 ] 36/58: memchr, syn, allocator-api2…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m indoc v2.0.7======> ] 40/58: pyo3-ffi, memchr, syn, hash…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m unindent v0.2.4=====> ] 43/58: memchr, syn, serde_json, on…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m safetensors-python v0.7.0-dev.0 (/kaggle/working/safetensors/bindings/python)\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m memmap2 v0.9.9=======> ] 47/58: pyo3-macros-backend, syn, s…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m serde_derive v1.0.228=> ] 49/58: pyo3-macros-backend, syn, s…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-macros v0.25.1====> ] 51/58: pyo3-macros-backend, serde_…\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m safetensors v0.7.0-dev.0 (/kaggle/working/safetensors/safetensors)\n\u001b[K\u001b[1m\u001b[92m Finished\u001b[0m `release` profile [optimized] target(s) in 18.32spython \n📦 Built wheel for abi3 Python ≥ 3.8 to /kaggle/working/safetensors/bindings/python/target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl\nProcessing ./target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl\nInstalling collected packages: safetensors\nSuccessfully installed safetensors-0.7.0.dev0\n","output_type":"stream"}],"execution_count":6},{"cell_type":"code","source":"!python3 -m pip show safetensors","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:38.495888Z","iopub.execute_input":"2025-12-12T17:03:38.496122Z","iopub.status.idle":"2025-12-12T17:03:40.470731Z","shell.execute_reply.started":"2025-12-12T17:03:38.496099Z","shell.execute_reply":"2025-12-12T17:03:40.470007Z"}},"outputs":[{"name":"stdout","text":"Name: safetensors\nVersion: 0.7.0.dev0\nSummary: \nHome-page: https://github.com/huggingface/safetensors\nAuthor: \nAuthor-email: Nicolas Patry <[email protected]>\nLicense: \nLocation: /usr/local/lib/python3.11/dist-packages\nRequires: \nRequired-by: accelerate, diffusers, peft, timm, torchtune, transformers\n","output_type":"stream"}],"execution_count":7},{"cell_type":"code","source":"!python3 safetensors/bindings/python/tests/test_gds.py","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:40.471678Z","iopub.execute_input":"2025-12-12T17:03:40.471969Z","iopub.status.idle":"2025-12-12T17:03:45.306618Z","shell.execute_reply.started":"2025-12-12T17:03:40.471932Z","shell.execute_reply":"2025-12-12T17:03:45.305925Z"}},"outputs":[{"name":"stdout","text":"test_gds_basic_loading (__main__.TestGDS.test_gds_basic_loading)\nTest basic GDS tensor loading to GPU. ... ERROR\ntest_gds_correctness (__main__.TestGDS.test_gds_correctness)\nTest that GDS loading produces correct results. ... ERROR\ntest_gds_cpu_device_error (__main__.TestGDS.test_gds_cpu_device_error)\nTest that GDS with CPU device raises an error. ... FAIL\ntest_gds_different_dtypes (__main__.TestGDS.test_gds_different_dtypes)\nTest GDS with different data types. ... ERROR\ntest_gds_large_tensor (__main__.TestGDS.test_gds_large_tensor)\nTest GDS with a large tensor to verify performance benefit. ... ERROR\ntest_gds_multiple_tensors (__main__.TestGDS.test_gds_multiple_tensors)\nTest loading multiple tensors with GDS. ... ERROR\ntest_gds_slicing_not_supported (__main__.TestGDS.test_gds_slicing_not_supported)\nTest that tensor slicing raises an error with GDS. ... ERROR\ntest_gds_without_cuda (__main__.TestGDS.test_gds_without_cuda)\nTest that GDS without CUDA device fails gracefully. ... ok\n\n======================================================================\nERROR: test_gds_basic_loading (__main__.TestGDS.test_gds_basic_loading)\nTest basic GDS tensor loading to GPU.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 43, in test_gds_basic_loading\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nERROR: test_gds_correctness (__main__.TestGDS.test_gds_correctness)\nTest that GDS loading produces correct results.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 62, in test_gds_correctness\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nERROR: test_gds_different_dtypes (__main__.TestGDS.test_gds_different_dtypes)\nTest GDS with different data types.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 116, in test_gds_different_dtypes\n with safe_open(dtype_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nERROR: test_gds_large_tensor (__main__.TestGDS.test_gds_large_tensor)\nTest GDS with a large tensor to verify performance benefit.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 137, in test_gds_large_tensor\n with safe_open(large_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nERROR: test_gds_multiple_tensors (__main__.TestGDS.test_gds_multiple_tensors)\nTest loading multiple tensors with GDS.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 74, in test_gds_multiple_tensors\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nERROR: test_gds_slicing_not_supported (__main__.TestGDS.test_gds_slicing_not_supported)\nTest that tensor slicing raises an error with GDS.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 91, in test_gds_slicing_not_supported\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n\n======================================================================\nFAIL: test_gds_cpu_device_error (__main__.TestGDS.test_gds_cpu_device_error)\nTest that GDS with CPU device raises an error.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 86, in test_gds_cpu_device_error\n self.assertIn(\"CUDA device\", str(context.exception))\nAssertionError: 'CUDA device' not found in 'GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds'\n\n----------------------------------------------------------------------\nRan 8 tests in 0.607s\n\nFAILED (failures=1, errors=6)\n","output_type":"stream"}],"execution_count":8},{"cell_type":"code","source":"!python3 safetensors/bindings/python/benches/test_gds.py","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:45.307523Z","iopub.execute_input":"2025-12-12T17:03:45.307756Z","iopub.status.idle":"2025-12-12T17:03:47.662210Z","shell.execute_reply.started":"2025-12-12T17:03:45.307724Z","shell.execute_reply":"2025-12-12T17:03:47.661490Z"}},"outputs":[{"name":"stdout","text":"\nBenchmarking 10 MB tensor...\n - Standard (mmap + GPU transfer)... 13.26 ms (753.9 MB/s)\n - GDS (NVMe + GPU)... Traceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 206, in <module>\n run_benchmark_suite()\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 130, in run_benchmark_suite\n time_gds = benchmark_gds_loading(filename, \"data\")\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 94, in benchmark_gds_loading\n with safe_open(filename, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: GPU Direct Storage is not available in this build. To enable GDS support, rebuild with: maturin build --features cuda-gds\n","output_type":"stream"}],"execution_count":9},{"cell_type":"code","source":"!python3 -m pip uninstall -y safetensors --break-system-packages && python3 -m pip show safetensors","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:47.663174Z","iopub.execute_input":"2025-12-12T17:03:47.663451Z","iopub.status.idle":"2025-12-12T17:03:49.521898Z","shell.execute_reply.started":"2025-12-12T17:03:47.663421Z","shell.execute_reply":"2025-12-12T17:03:49.521168Z"}},"outputs":[{"name":"stdout","text":"Found existing installation: safetensors 0.7.0.dev0\nUninstalling safetensors-0.7.0.dev0:\n Successfully uninstalled safetensors-0.7.0.dev0\n\u001b[33mWARNING: Package(s) not found: safetensors\u001b[0m\u001b[33m\n\u001b[0m","output_type":"stream"}],"execution_count":10},{"cell_type":"code","source":"!bash -lc \"source $HOME/.cargo/env && cd safetensors/bindings/python/ && maturin build --release --features cuda-gds && python3 -m pip install target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl --break-system-packages --force-reinstall\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:03:49.522881Z","iopub.execute_input":"2025-12-12T17:03:49.523112Z","iopub.status.idle":"2025-12-12T17:04:06.074234Z","shell.execute_reply.started":"2025-12-12T17:03:49.523088Z","shell.execute_reply":"2025-12-12T17:04:06.073477Z"}},"outputs":[{"name":"stdout","text":"🍹 Building a mixed python/rust project\n⚠️ Warning: You're building a library without activating pyo3's `extension-module` feature. See https://pyo3.rs/v0.25.1/building-and-distribution.html#the-extension-module-feature\n🔗 Found pyo3 bindings with abi3 support\n🐍 Found CPython 3.11 at /usr/bin/python3\n📡 Using build options bindings from pyproject.toml\n\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-build-config v0.25.1\n\u001b[1m\u001b[92m Compiling\u001b[0m safetensors-python v0.7.0-dev.0 (/kaggle/working/safetensors/bindings/python)\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-macros-backend v0.25.1 ] 46/58: pyo3-build-config \u001b[1m\u001b[96m Building\u001b[0m [===================> ] 45/58: pyo3-build-config(build) \n\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-ffi v0.25.1\n\u001b[1m\u001b[92m Compiling\u001b[0m pyo3 v0.25.1\n\u001b[K\u001b[1m\u001b[92m Compiling\u001b[0m pyo3-macros v0.25.1======> ] 54/58: pyo3-macros-backend \n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `driver::GdsDriver`\u001b[0mtensors-python \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/mod.rs:18:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m18\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use driver::GdsDriver;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `error::GdsError`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/mod.rs:20:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m20\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use error::GdsError;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `handle::GdsHandle`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/mod.rs:22:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m22\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use handle::GdsHandle;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused variable: `result`\u001b[0m/58: safetensors-python \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/handle.rs:78:21\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m78\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let result = cuFileHandleDeregister(self.handle);\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m \u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_result`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: method `is_initialized` is never used\u001b[0msors-python \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/driver.rs:64:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl GdsDriver {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------\u001b[0m \u001b[1m\u001b[94mmethod in this implementation\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m64\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn is_initialized(&self) -> bool {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: method `fd` is never used\u001b[0m/58: safetensors-python \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/handle.rs:62:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m21\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl GdsHandle {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------\u001b[0m \u001b[1m\u001b[94mmethod in this implementation\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m62\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn fd(&self) -> i32 {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `path` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/storage.rs:11:5\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m9\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct GdsStorage {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m----------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m10\u001b[0m \u001b[1m\u001b[94m|\u001b[0m handle: GdsHandle,\n\u001b[1m\u001b[94m11\u001b[0m \u001b[1m\u001b[94m|\u001b[0m path: PathBuf,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: methods `path` and `size` are never used\u001b[0ms-python \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/storage.rs:36:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m15\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl GdsStorage {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------------\u001b[0m \u001b[1m\u001b[94mmethods in this implementation\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m36\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn path(&self) -> &PathBuf {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn size(&self) -> usize {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: creating a shared reference to mutable static\u001b[0mhon \n \u001b[1m\u001b[94m--> \u001b[0msrc/gds/driver.rs:44:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m44\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m/\u001b[0m DRIVER_INSTANCE\n\u001b[1m\u001b[94m45\u001b[0m \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m|\u001b[0m .clone()\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m|________________________^\u001b[0m \u001b[1m\u001b[33mshared reference to mutable static\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default\n\n\u001b[K\u001b[1m\u001b[33mwarning\u001b[0m: `safetensors-python` (lib) generated 9 warnings (run `cargo fix --lib -p safetensors-python` to apply 4 suggestions)\n\u001b[1m\u001b[92m Finished\u001b[0m `release` profile [optimized] target(s) in 11.58s\n🖨 Copied external shared libraries to package safetensors.libs directory:\n /usr/local/cuda-12.5/targets/x86_64-linux/lib/libcufile.so.1.10.1\n /usr/lib/x86_64-linux-gnu/libpython3.11.so.1.0\n📦 Built wheel for abi3 Python ≥ 3.8 to /kaggle/working/safetensors/bindings/python/target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl\nProcessing ./target/wheels/safetensors-0.7.0.dev0-cp38-abi3-manylinux_2_34_x86_64.whl\nInstalling collected packages: safetensors\nSuccessfully installed safetensors-0.7.0.dev0\n","output_type":"stream"}],"execution_count":11},{"cell_type":"code","source":"!python3 safetensors/bindings/python/tests/test_gds.py","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:04:06.075191Z","iopub.execute_input":"2025-12-12T17:04:06.075405Z","iopub.status.idle":"2025-12-12T17:04:09.083451Z","shell.execute_reply.started":"2025-12-12T17:04:06.075382Z","shell.execute_reply":"2025-12-12T17:04:09.082745Z"}},"outputs":[{"name":"stdout","text":"test_gds_basic_loading (__main__.TestGDS.test_gds_basic_loading)\nTest basic GDS tensor loading to GPU. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_correctness (__main__.TestGDS.test_gds_correctness)\nTest that GDS loading produces correct results. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_cpu_device_error (__main__.TestGDS.test_gds_cpu_device_error)\nTest that GDS with CPU device raises an error. ... ok\ntest_gds_different_dtypes (__main__.TestGDS.test_gds_different_dtypes)\nTest GDS with different data types. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_large_tensor (__main__.TestGDS.test_gds_large_tensor)\nTest GDS with a large tensor to verify performance benefit. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_multiple_tensors (__main__.TestGDS.test_gds_multiple_tensors)\nTest loading multiple tensors with GDS. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_slicing_not_supported (__main__.TestGDS.test_gds_slicing_not_supported)\nTest that tensor slicing raises an error with GDS. ... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nERROR\ntest_gds_without_cuda (__main__.TestGDS.test_gds_without_cuda)\nTest that GDS without CUDA device fails gracefully. ... ok\n\n======================================================================\nERROR: test_gds_basic_loading (__main__.TestGDS.test_gds_basic_loading)\nTest basic GDS tensor loading to GPU.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 43, in test_gds_basic_loading\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n======================================================================\nERROR: test_gds_correctness (__main__.TestGDS.test_gds_correctness)\nTest that GDS loading produces correct results.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 62, in test_gds_correctness\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n======================================================================\nERROR: test_gds_different_dtypes (__main__.TestGDS.test_gds_different_dtypes)\nTest GDS with different data types.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 116, in test_gds_different_dtypes\n with safe_open(dtype_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n======================================================================\nERROR: test_gds_large_tensor (__main__.TestGDS.test_gds_large_tensor)\nTest GDS with a large tensor to verify performance benefit.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 137, in test_gds_large_tensor\n with safe_open(large_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n======================================================================\nERROR: test_gds_multiple_tensors (__main__.TestGDS.test_gds_multiple_tensors)\nTest loading multiple tensors with GDS.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 74, in test_gds_multiple_tensors\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n======================================================================\nERROR: test_gds_slicing_not_supported (__main__.TestGDS.test_gds_slicing_not_supported)\nTest that tensor slicing raises an error with GDS.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/tests/test_gds.py\", line 91, in test_gds_slicing_not_supported\n with safe_open(self.test_file.name, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n\n----------------------------------------------------------------------\nRan 8 tests in 0.840s\n\nFAILED (errors=6)\n","output_type":"stream"}],"execution_count":12},{"cell_type":"code","source":"!python3 safetensors/bindings/python/benches/test_gds.py","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-12T17:04:09.084333Z","iopub.execute_input":"2025-12-12T17:04:09.084530Z","iopub.status.idle":"2025-12-12T17:04:11.806777Z","shell.execute_reply.started":"2025-12-12T17:04:09.084510Z","shell.execute_reply":"2025-12-12T17:04:11.806084Z"}},"outputs":[{"name":"stdout","text":"\nBenchmarking 10 MB tensor...\n - Standard (mmap + GPU transfer)... 13.01 ms (768.9 MB/s)\n - GDS (NVMe + GPU)... cuFile operation 'cuFileHandleRegister' failed: err=5030, cu_err=0\nTraceback (most recent call last):\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 206, in <module>\n run_benchmark_suite()\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 130, in run_benchmark_suite\n time_gds = benchmark_gds_loading(filename, \"data\")\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/kaggle/working/safetensors/bindings/python/benches/test_gds.py\", line 94, in benchmark_gds_loading\n with safe_open(filename, framework=\"pt\", device=\"cuda:0\", use_gds=True) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsafetensors_rust.SafetensorError: Failed to initialize GPU Direct Storage: cuFile error: err=5030, cuda_err=0 (check NVIDIA GDS documentation). Make sure libcufile.so is available and you have a supported NVIDIA GPU.\n","output_type":"stream"}],"execution_count":13}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment