Downloads · 30 days
0
kiruluta/rsil-benchmark
rsil-benchmark is a machine learning model from kiruluta. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
Research code for Resonant Spectral Interaction Ladders: Translation-Equivariant Higher-Order Token Mixing with Kolmogorov-Arnold Parameterizations. The repository is designed to let collaborators test the architectur…
Downloads · 30 days
0
Access
Public
Updated Sep 20, 2026
Repo size
427 MB
Likes
0
Public
Click a slice to open those files.
.pt548 MB · 100%
From the Hugging Face model README
Research code for Resonant Spectral Interaction Ladders: Translation-Equivariant Higher-Order Token Mixing with Kolmogorov-Arnold Parameterizations. The repository is designed to let collaborators test the architecture locally, then scale the same training loop to multi-GPU/FSDP or DeepSpeed and streaming corpora.
Research status: experimental reference implementation, not a pretrained production model. The current language objective is bidirectional masked language modeling. The FFT mixer is global/non-causal, so this repo intentionally does not claim autoregressive next-token generation without a separate causal construction.
We are seeking collaborators with access to multi-GPU systems to independently reproduce and scale RSIL from approximately 50M to 1B+ parameters.
Priority areas include multi-node training, large-corpus pretraining, optimized FFT/resonance kernels, long-context experiments, and independent reproduction.
Both positive and negative results are encouraged.
See COLLABORATION_CALL.md and the repository Discussions for the
current scaling program.
datasets streaming input remains available for scaling runs.Accelerate launch path with DDP/FSDP/DeepSpeed configuration examples.paper.pdf) for theory and novelty scope.git clone <YOUR-HF-REPO-URL>
cd rsil
python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
pytest -q
accelerate launch -m rsil.train \
--config configs/model/base.yaml \
--dataset HuggingFaceFW/fineweb-edu \
--tokenizer bert-base-uncased \
--steps 100 --batch-size 2 --out outputs/smoke
The dataset is streamed rather than downloaded in full. For serious experiments, pin dataset revisions and tokenizer versions and record them in your run metadata.
Review num_processes and FSDP options for your cluster, then:
accelerate launch --config_file configs/accelerate/fsdp.yaml -m rsil.train \
--config configs/model/large.yaml \
--dataset HuggingFaceFW/fineweb-edu \
--tokenizer bert-base-uncased \
--steps 100000 --batch-size 4 --grad-accum 8 \
--out outputs/large
For DeepSpeed ZeRO-3, replace the config with configs/accelerate/deepspeed_zero3.yaml.
Generate a cluster-specific config with accelerate config, or edit num_machines, num_processes, machine_rank, rendezvous settings, and networking for your scheduler. Prefer a shared experiment configuration committed to a branch/PR rather than changing model code per cluster.
hf auth login
accelerate launch -m rsil.train ... --push-to-hub YOUR_ORG/rsil-base-experiment
For very large checkpoints, use Hugging Face's current large-file/Xet workflow. Keep code, small configs, model cards, and reproducibility metadata in Git; use Hub model/dataset repositories for weights and data artifacts.
main branch.The reference code favors clarity over fused-kernel performance. Before billion-parameter or very-long-context runs, profile: repeated FFT/IFFT calls, band materialization, cross-band products, activation memory, and communication. High-value systems contributions include fused band filtering, cached masks, lower-rank channel factors, torch.compile, activation checkpointing, sequence parallelism, and custom Triton/CUDA kernels.
Start with 10M–100M parameter models and sequence lengths 512–4096. Compare: Transformer encoder, Fourier mixer + MLP, RSIL with degree 1 only, degree 1+2, degree 1+2+3, and alternative univariate gain parameterizations. Then scale only variants that show stable loss/throughput gains. Report parameters, FLOPs/tokens, wall-clock throughput, peak memory, MLM loss/perplexity-like masked-token metrics, and translation-equivariance error.
src/rsil/model.py architecture
src/rsil/data.py streaming HF data pipeline
src/rsil/train.py Accelerate training entry point
configs/model/ model scales
configs/accelerate/ FSDP / DeepSpeed examples
tests/ correctness smoke tests
paper.pdf theory manuscript
CONTRIBUTING.md collaboration rules
MODEL_CARD.md experiment/model-card template
A BibTeX placeholder is provided in CITATION.cff; replace author metadata and publication identifiers before public release.
Apache-2.0 for the code. Confirm manuscript/data licensing separately before public release.
The CI/smoke data path is now completely independent of Hugging Face datasets and tokenizers. --dataset synthetic creates deterministic masked-token examples locally using an index-seeded PyTorch generator. It reserves token 0 for padding and token 1 for masking, emits -100 labels for unmasked positions, and guarantees at least one masked token per sample.
# unit tests
make test
# all six benchmark families, tiny deterministic offline run
make ci-benchmark
# larger local smoke run, still no corpus download
make smoke
Use --seed, --synthetic-vocab-size, and --synthetic-samples to control reproducibility. The synthetic benchmark validates implementation, training, matching, checkpoint generation, and CI plumbing only; it must not be used for language-quality conclusions. Real-corpus scaling remains available by passing a Hugging Face dataset name.
The benchmark suite trains six families under a common masked-LM data/training pipeline: transformer, fourier, rsil_d1, rsil_d2, rsil_d3, and rsil_mlp (non-KAN control). The anchor is matched by an automatic width search that minimizes the maximum relative error in parameter count and an analytic forward-FLOP proxy. Both ratios are emitted in every result so runs outside the requested tolerance are visible rather than silently treated as matched.
Quick offline smoke benchmark (no Hugging Face dataset or tokenizer download):
pip install -e .
./scripts/run_benchmark.sh --config configs/benchmark/smoke.yaml --dataset synthetic --steps 100 --seq-len 256 --out outputs/smoke
The v2.1 benchmark harness defaults to --dataset synthetic. Samples, masks, and token IDs are generated deterministically from --seed; the default synthetic vocabulary is 4096 tokens. This path is intended for CI, correctness, checkpoint plumbing, and local benchmark validation—not language-quality claims. Use FineWeb-Edu or another real corpus only for scaling experiments.
Multi-GPU/FSDP:
accelerate launch --config_file configs/accelerate/fsdp.yaml -m rsil.benchmark.harness \
--config configs/benchmark/scale.yaml --steps 10000 --seq-len 2048 \
--mixed-precision bf16 --out outputs/scale
Outputs include per-model checkpoints/metrics plus leaderboard.csv and summary.json. FLOPs are a reproducible analytic proxy for budget matching, not a claim of measured hardware FLOPs; report measured throughput alongside it.
v2.2 fixes the preliminary WikiText failure in v2.1. The real-corpus path now removes raw strings by construction: it tokenizes documents, concatenates token IDs into a rolling stream, packs exact fixed-length blocks, and applies deterministic MLM corruption only after packing. The DataLoader uses zero workers for reproducibility and compatibility with one-shard streams such as WikiText-2.
Run the real preliminary comparison with:
./scripts/run_real_preliminary.sh
For a short validation before a 2,000-step run:
STEPS=20 ./scripts/run_real_preliminary.sh
Synthetic CI remains completely offline via make ci-benchmark. Real-language WikiText requires network access for the dataset/tokenizer on first use.
Run a short validation first:
STEPS=20 ./scripts/run_real_preliminary.sh
Then the 2,000-step preliminary benchmark:
rm -rf outputs/real_preliminary
./scripts/run_real_preliminary.sh
Collect the locally generated checkpoints and result files into the Hugging Face publication tree:
./scripts/collect_real_release.sh outputs/real_preliminary
The tokenizer may consume source documents longer than BERT's nominal 512-token model limit while constructing the continuous packed stream. This is intentional: the model itself only receives fixed --seq-len blocks (256 by default).
Real-data packing now uses the fast tokenizer backend directly before fixed-length packing. This prevents Transformers from emitting misleading model_max_length warnings for long source paragraphs while preserving every token for subsequent 256-token blocks. The model still receives only seq_len tokens.
The release-candidate benchmark trains on WikiText-2 train and evaluates each checkpoint on the held-out validation split. The leaderboard now records train_loss, validation_loss, validation_perplexity, throughput, parameter count, and the analytic FLOP proxy. Per-model history.csv files support loss-vs-step plots.
Run the single-seed release candidate with ./scripts/run_real_preliminary.sh. For a stronger result, run SEEDS="20260920 20260921 20260922" ./scripts/run_multiseed.sh. Generate figures with python scripts/plot_results.py --run outputs/real_preliminary --out publish/plots.
The small WikiText experiment is a preliminary controlled benchmark, not a claim of architecture superiority. The intended collaboration target is independent replication and scaling at 50M, 100M, 300M, and 1B+ parameters under matched parameter/compute budgets, with wall-clock throughput and memory reported alongside quality metrics.