Repository navigation
Add GetTensorRaw and ToGGMLQuantType for GGML quantized weights - #18
Merged
Merged
Conversation
- Add Model.GetTensorRaw() to load raw tensor bytes without dequantization, enabling quantized weights to stay in native format - Add TensorType.ToGGMLQuantType() mapping GGUF tensor types to GoMLX GGMLQuantType (Q4_0, Q8_0, IQ4_NL, Q2_K–Q6_K) - Update go.mod dependencies Depends on: ajroetker/gomlx#6
- Multi-file GGUF: support multimodal models (e.g. LLaVA) that split tensors across multiple GGUF files via LoadAll/LoadFiles/ListGGUFFiles. Tensors are looked up across all files transparently. - Pair extra files with their readers in a single extraEntry struct to prevent parallel-slice divergence and enable per-file lazy reader init. - Fix Close() to close all readers instead of leaking on first error. - Deduplicate .gguf filename filtering into a shared ggufFileNames helper. - Add FlexToken type to handle HuggingFace token config fields that can be either a plain string or an object with a "content" field. - Update go-xla, golang.org/x/sys, k8s.io/klog dependencies.
janpfeifer
requested changes
Mar 13, 2026
…p FlexToken - Rename GetTensor→ReadTensor, GetTensorRaw→ReadTensorBytes per reviewer convention (Read prefix for I/O methods) - Merge findTensorFile+fileForIndex into findTensor to avoid double map lookup in GetTensorInfo and readerForTensor - Return error instead of silently swallowing invalid JSON in FlexToken.UnmarshalJSON - Remove unused FlexToken.String() method - Replace 7 copy-pasted config fallback blocks in resolveSpecialTokens with table-driven loop
…ormer models. (Tested with tencent/KaLM-Embedding-Gemma3-12B-2511)
Added the `models/transformer` package.
Cleanup, improved documentation.
- Refactor `hub.Repo` functionality so it can be shared with `datasets`
Added dataset pretty printing.
Added API to iterate over parquet files.
Support for HuggingFace Datasets.
…ethods. - Updated README.md and added some examples. - Updated go.mod dependencies.
GetTokenizers/SetTokenizers; README.md
Fixed Model.LoadContext to return an error.
…oader bug fixes (gomlx#62) * Fixed report of false error, described in gomlx#61 * Replaced Semaphore with a FIFOSemaphore; Added support for Context in the FIFOSemaphore; Fixes gomlx#60 * - 20Cache and offline reliability improvements in `hub`: - Avoid re-downloading model revision info when it is already cached by default. Documented update polling via `DownloadInfo(true)`. - Short-circuit revision lookup when `revision` is already a 40-character commit hash. - Removed unused `revisionHashRefreshed` field. - Fixed `LockedDownload` to preserve existing cached files until a forced re-download successfully completes and atomically replaces them, avoiding cache deletion on network failure (issue gomlx#59). * Updated CHANGELOG with other bug fixes. * Added .agents/AGENTS.md
* fix(hub): accept string or array for cardData.license Hugging Face Hub may return license as a JSON array; unmarshaling into a string field broke DownloadInfo for datasets like bigcode/the-stack. Signed-off-by: Sobha Cheruku <scheruku@redhat.com> * test: skip live Hub license test in short mode * fix: update CardData.License as []string --------- Signed-off-by: Sobha Cheruku <scheruku@redhat.com>
…rmalizer (fixes gomlx#67) (gomlx#68) * Created issue gomlx#67 test. * Refactored the normalizer out of `hftokenizer.go` into `normalizer.go` Large cleanups and simplification of the code, in particular the handling of the offsets from the normalize string to the original string. * Refactored tests into their corresponding files.
…/ `Repo.SaveCtx` when `linkOnly=true` so hard links point to the underlying blob files rather than copying relative snapshot symlinks. (gomlx#70)
…ation models (models/timestral) (gomlx#71) * Updated dependencies. * Added `timestral` times series foundational model support.
…without mmap (gomlx#72) * Make loading files with MMap optional. * More memory debugging options; added -mmap flag. * Removed the inserted GC used for debugging. * Updated dependen 8 cies.
* - `models/timestral`:
- Fused attention `_gate` projection (`Dense` + `Sigmoid`) into a single `nn.Dense(..., activation.TypeSigmoid)` (`FusedDense` with `ActivationSigmoid`).
- Swapped `w12` `[gate; up]` halves to `[up; gate]` at weight-load time and replaced manual `Slice` + `Silu` + `Mul` in `FusedSwiGLU` with `activation.SwiGLU(w12)`.
- `examples/timestral`: Format elapsed durations using `humanize.Duration()`.
* Updated dependencies.
…via `github.com/gomlx/onnx-gomlx` when `.safetensors` files are not available in the model repository (e.g. `KnightsAnalytics/all-MiniLM-L6-v2`).
- `models/transformer`:
- Added `Model.SentenceEmbeddingFromLastHiddenState(lastHiddenState, seqLen)` to apply post-Transformer sentence embedding modules (pooling and L2 normalization) to an existing hidden-state tensor.
Contributor
|
hey @ajroetker , sorry this was never followed up on. You are probably not interested in this anymore, but just FYI, I merged the updates, did a couple of fixes, and merged everything 😃 THanks again for all contributions!! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Model.GetTensorRaw()to load raw tensor bytes without dequantization, keeping quantized weights in their native GGML block formatTensorType.ToGGMLQuantType()mapping GGUF tensor types to GoMLXGGMLQuantType(Q4_0, Q8_0, IQ4_NL, Q2_K–Q6_K)Dependencies
Depends on ajroetker/gomlx#6 — the
go.modreplace directive will be updated to a proper module version once that PR merges.