modal-nacrith-gpu

Nacrith-GPU compression system running on Modal serverless.
git clone https://unitehenry.com/git/modal-nacrith-gpu.git
Log | Files | Refs | README

README.md (1742B)


      1 
      2 [Nacrith-GPU](https://github.com/robtacconelli/Nacrith-GPU) compression system running on Modal serverless.
      3 
      4 ## Getting Started
      5 
      6 ```bash
      7 # 1. Authenticate with modal
      8 uvx modal setup
      9 
     10 # 2. Compress file
     11 scripts/compress path/to/file.txt
     12 
     13 # 3. Decompress file
     14 scripts/decompress file.txt.nc
     15 ```
     16 
     17 ## Throughput
     18 
     19 > With a single worker on the GTX 1050 Ti, Nacrith achieves ∼50–70 tokens/second at the start of a file, settling to ∼20–30 tok/s as the KV cache fills to its 2,048-token steady state (attention cost scales linearly with cached positions). With 3 parallel workers (the maximum for 4 GB VRAM), aggregate throughput scales to ∼60–90 tok/s [^1]
     20 
     21 ### Benchmarks
     22 
     23 | Method   | Per-Item Size | Total Size (20 items) | Notes                  |
     24 |----------|---------------|-----------------------|------------------------|
     25 | Original | 250 KB        | 5 MB                  | Uncompressed baseline  |
     26 | Nacrith  | 8 KB          | 160 KB                |                        |
     27 | Zstd     | -             | 260 KB                | Compressed from 5 MB   |
     28 
     29 This Modal app runs inference on an H100 which gets ~500-1000 tok/s. As a benchmark, a ~5MB log file (~3M tokens) takes about an hour to compress. [^2]
     30 
     31 ### Batch Compression
     32 
     33 There is a batch compression function that breaks text-based file contents into n-chunks and spawn a `compress` instance to perform compression on each chunk concurrently. The 5MB log file used to benchmark goes from an hour to ~5 minutes to compress.
     34 
     35 ```bash
     36 scripts/batch path/to/file.txt
     37 ```
     38 
     39 [^1]: [Nacrith: Neural Lossless Compression via Ensemble Context Modeling and High-Precision CDF Coding](https://arxiv.org/abs/2602.19626)
     40 
     41 [^2]: [Loghub: Apache](https://github.com/logpai/loghub)