Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/692db884-c2d8-800c-a357-aa2a0e684fbe
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== ### ==== The hook is designed to sit in the execution path where: * GPU memory is allocated / freed * Tensors / buffers are written / read * Certain operations that use those buffers are launched. Instead of rewriting your model scripts, you attach this hook so that when your framework thinks it’s doing a normal CUDA call, it actually passes through the LoreToken layer first. To your training script, nothing looks different: * Same shapes * Same dtypes * Same API surface Under the hood, the hook is managing compressed memory. ===== It doesn’t just naively zip everything. It uses several GPU-friendly strategies (taken from your compression report): ===== * Zero-run encoding – When activations come out of things like ReLU, huge slices are literal zero. Those get stored as “runs of zeros” instead of full arrays. * Sparse matrix compression – Pruned / near-sparse weight matrices are stored in “only store non-zeros + where they go” formats. * Value dictionaries / quantization – If many values repeat or fall into small numeric ranges, it can store them as small integer codes plus a tiny lookup table. * Batch delta compression – When inputs or internal states across a batch are very similar, it stores “this one is like that one, plus small deltas.” * LoreToken semantic compression – For structured stuff (prompts, KV cache with repeating patterns, etc.), it uses your LoreToken-style symbolic patterns instead of raw numeric soup. Each of those is chosen because it: * Compresses well * Can be decoded insanely fast on GPU * Fits the tensor layout the model expects. ===== Instead of leaving raw tensors sitting in VRAM, it: ===== # Stores a compact representation (compressed blobs + tiny metadata). # Keeps track of what logical tensor each blob belongs to. # Treats raw, expanded tensors as temporary views that can be reconstructed when needed. So from CUDA’s perspective, you “have” a big tensor in VRAM, but really you have: * A compressed blob * Plus a decoder that can rebuild it fast enough that you don’t care. ===== When a kernel actually needs to do math on some data: ===== # The hook detects that the underlying tensor is stored in compressed form. # It allocates a temporary working buffer (or reuses a small pool). # Decodes the compressed representation into that buffer. # Hands the pointer to CUDA as if it were the original, uncompressed tensor. # After the operation, it can: - Recompress updated data, or - For read-only weights, just discard the temporary buffer. This is how you get the equivalent of “24 GB card pretending to be 100+ GB”: * You never keep all tensors fully expanded at once. * You only expand what you’re actively touching right now. ===== From the summary + logs, there are clear safety rails: ===== * Error/Integrity checks If decode errors, mismatched sizes, or suspicious corruption show up more than a tiny threshold, the hook can: - Log it - Fail that path - Or fall back to an uncompressed / pass-through mode. * Thermal & power guardrails It monitors temps, power draw, and performance. If compression/decoding stress pushes the GPU outside conservative limits, it can back off. * Performance sanity checks If compression makes things slower than a defined “acceptable penalty,” it can selectively skip compressing certain tensors or disable itself. All of that is there so that from the outside, your system either: * Runs faster / with more effective VRAM, or * Silently behaves like normal CUDA if something isn’t right.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)