commit 7ebc1e796461437d6b7a0d236d519ac8f49bdb20
parent e3899f2a8747809be61a8d2708ac1b7d8f2a7bfd
Author: Henry Unite <unitehenry@gmail.com>
Date: Wed, 10 Jun 2026 16:12:37 +0000
feat: optionally build cuda for modal
Diffstat:
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/compression.py b/compression.py
@@ -14,7 +14,7 @@ image = (
"apt-get -y install cuda-toolkit-12-8",
]
)
- .env({"PATH": "/usr/local/cuda/bin:$PATH"})
+ .env({"PATH": "/usr/local/cuda/bin:$PATH", "MODAL": "1"})
.run_commands(["mkdir /scripts"])
.add_local_file("scripts/smollm2", "/scripts/smollm2", copy=True)
.add_local_file("scripts/nacrith", "/scripts/nacrith", copy=True)
@@ -42,14 +42,14 @@ def run(commands):
finally:
os.unlink(path)
-@app.function(gpu="A10", image=image, volumes={ "/data": vol })
+@app.function(gpu="H100", image=image, volumes={ "/data": vol })
def compress(file_name):
run([
"source /Nacrith-GPU/venv/bin/activate",
f'python /Nacrith-GPU/cli.py compress "/data/{file_name}" "/data/{file_name}.nc"',
])
-@app.function(gpu="A10", image=image, volumes={ "/data": vol })
+@app.function(gpu="H100", image=image, volumes={ "/data": vol })
def decompress(file_name):
outfile = "".join(file_name.rsplit(".nc", 1))
diff --git a/scripts/nacrith b/scripts/nacrith
@@ -20,4 +20,11 @@ source venv/bin/activate
pip install torch
pip install transformers accelerate numpy
-CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --force-reinstall --no-cache-dir
+CMAKE_ARGS="-DGGML_CUDA=on"
+
+if [ "$MODAL" = "1" ]; then
+ # Build for H100
+ CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CUDA_ARCHITECTURES=90"
+fi
+
+CMAKE_ARGS="$CMAKE_ARGS" pip install llama-cpp-python --force-reinstall --no-cache-dir