File size: 6,185 Bytes
9b6961f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | # Kaggle, Colab and other GPU evaluation
Download kaggle_lm_eval.ipynb from the public dataset
https://huggingface.co/datasets/vanshnawander/structured-diffusion-eval
and import it into Kaggle. Enable Internet and GPU in notebook settings.
No Modal account or HF token is needed to download the 27 public pruned models.
The notebook defaults to one selected checkpoint. Change MODEL_INDEX or REPOS
for each GPU session. EVALUATE_ALL_MODELS=True selects all 27 original pruned
checkpoints. NUM_WORKERS and WORKER_INDEX partition checkpoint/task pairs exactly
once between independent sessions. All seven benchmarks (ARC-Easy, Winogrande,
PIQA, ARC-Challenge, HellaSwag, BoolQ, GSM8K) and both WikiText-2/C4 perplexities
are enabled. The full grid is 189 benchmark tasks plus 54 PPL datasets.
The authoritative config is copied from
Pruning-LLMs/diffusion_eval_and_vis/config.py. The notebook prints the complete
effective config, adapter arguments and assignments before loading weights.
MC samples remain 128; generation stays at 256 steps, LLaDA length/block 1024,
Dream length 256, seed 42, original guidance/remasking, five-shot GSM8K and
zero-shot other tasks. It does not reduce dataset sizes or generation lengths.
The shared profile keeps BF16 and MC mini-batch 32. The explicit kaggle profile
uses mini-batch 1 with dtype=auto (FP16 on T4, BF16 on supporting hardware).
This changes precision and the stochastic mini-batch grouping. Use the same
profile for all comparisons. Profiles/revisions have separate output directories
and merge groups. CPU/disk offload preserves model weights; there is no
quantization. Auto device mapping can use both GPUs in a T4 x2 session. One
evaluation is model-sharded; this is not two independent replicas.
Model snapshots/offload weights go in /kaggle/temp, outside saved outputs.
Only evaluation results, response caches and RNG/PPL recovery state are saved
in /kaggle/working/results. Likelihood saves each response in the notebook;
generation saves each answer; perplexity saves each completed sequence.
SESSION_HOURS defaults to 8. The runner commits progress and returns before
the platform deadline; time budgets are checked between requests/sequences,
so one outstanding request may finish after the budget.
Use Save Version > Save & Run All for background execution on Kaggle.
The final cell produces evaluation_results_worker-<index>.zip. Download/save
outputs before discarding an interactive session. Attach that output to the
next notebook, set RESTORE_ZIP to the archive path under /kaggle/input, and
rerun with the same config and SHA. Scores already computed are replayed
without another forward pass. Resumption retains RNG state; hardware/precision
changes can still alter floating-point results.
Existing Modal results/partial responses are available in modal_progress.zip.
IMPORT_MODAL_PROGRESS=True imports them into the original BF16/32 profile.
They are not reused for FP16/1 evaluations. Saved original pruning models and
unfinished LoRA recovery files remain preserved. No paid Modal work runs.
Original SliceGPT uploads are pruned baselines. None completed the requested
sequential LoRA before the budget stop. Select a final fine-tuned repository
and enable REQUIRE_FINETUNED_SLICE to enforce post-LoRA evaluation; this guard
refuses a baseline without finetune_manifest.json. Baseline SliceGPT scores
must not be presented as fine-tuned scores.
For a terminal, extract portable_eval.zip and install requirements.txt:
python portable_eval/runner.py --show-config --repo MODEL
python portable_eval/run_suite.py --repos MODEL --batch-size 1 --dtype auto --output results --time-budget-seconds 28800
python portable_eval/run_suite.py --repos MODEL --num-workers 3 --worker-index 0 --batch-size 1 --dtype auto --output results
python portable_eval/runner.py --repo MODEL --units ppl:c4 --batch-size 1 --dtype auto --output results
python portable_eval/runner.py --repo MODEL --tasks piqa --limit 2 --skip-ppl --batch-size 1 --dtype auto --output smoke_results
Omit --repos to assign the entire 27-model grid. Use --plan to preview without
a GPU. Full evaluations omit --limit. Smoke outputs stay separate from full
metrics. To combine worker outputs, extract ZIPs into a common directory:
python portable_eval/runner.py --merge combined/results --output merged_results.json
The merger includes benchmark and PPL metrics, rejects conflicting duplicates,
and never combines different checkpoint SHAs/effective settings into one row.
Verification uses local tiny LLaDA/Dream models for each pruning method, real
lm-eval scoring, sliced precision conversion/offload, and uninterrupted versus
resumed PPL equality. This is not a full 7B/8B run inside a Kaggle account.
References: https://www.kaggle.com/docs/notebooks
https://github.com/EleutherAI/lm-evaluation-harness
https://huggingface.co/docs/accelerate/concept_guides/big_model_inference
The companion kaggle_slicegpt_lora.ipynb completes the nine unfinished sequential
fine-tunes using the same diffusion objective and LoRA hyperparameters. Choose
one original SliceGPT source per session, use both T4 GPUs or a larger GPU, and
keep all weights on GPUs. The trainer refuses CPU/disk training offload.
FP16 training is explicitly recorded as a separate precision profile; matching
BF16 training requires supporting hardware. It checkpoints and exits at the
session time budget, relocates recovery paths when restoring notebook output,
merges/reloads/verifies, and can upload a public HF checkpoint using HF_TOKEN
from Kaggle Secrets. Evaluation follows in a separate notebook with the uploaded
repo and REQUIRE_FINETUNED_SLICE=True. This guard is enabled by default in the
evaluation notebook, so original SliceGPT baseline scores require an explicit
opt-out.
The two paid BF16 LoRA recovery states are downloadable as
modal_training_recovery.zip. RESTORE_MODAL_BF16=True in the training notebook
imports the chosen saved optimizer/adapter state, relocates its paths and
requires the unchanged BF16 training configuration. Sources which never started
have no recovery state. FP16 training intentionally starts a separate run.
|