Commit Graph
137 Commits
Author SHA1 Message Date
pliny 262e8183dc Merge pull request #122 from younger-plinius/restore-multimodal-v2
restore-multimodal CLI command
2026-08-19 22:23:08 -04:00
faber aa3095747c test cli dispatch 2026-08-19 21:38:19 -04:00
faber c0b3ad9007 tests: 98% coverage 2026-08-19 21:33:25 -04:00
faber d90945e8ee restore-multimodal + tests + risk map 2026-08-19 21:20:09 -04:00
faber cd09c259c0 restore-multimodal CLI + risk map 2026-08-19 21:06:06 -04:00
pliny 76494180da Merge pull request #118 from younger-plinius/corpus-uplevel-llm-redteam
corpus uplevel + llm red-team prompts + backend fixes
2026-08-19 12:21:22 -04:00
faber 482dfed8c0 2026-08-19 11:33:45 -04:00
Joseph Magly cb4aec4532 fix: bind CI evidence to pull request head 2026-08-16 18:22:19 -04:00
Joseph Magly 497a2eeda2 fix: distinguish signing key id from fingerprint 2026-08-16 17:39:55 -04:00
Joseph Magly 0f6be47948 docs: align contributor standards with BT6 gates 2026-08-16 17:36:34 -04:00
Joseph Magly b25b3f3b66 fix: harden quantized checkpoint integration 2026-08-16 12:57:17 -04:00
Brian Bell b6a1727cb6 test+docs: quant_dequant test suite, theory journal engineering log
33 CPU-only tests: FP8 block-wise/per-channel round-trips, NVFP4
round-trips (direct + reciprocal scales, native vs manual unpack
agreement), scheme detection incl. ModelOpt MIXED_PRECISION, surgery
guard raises, and tiny synthetic FP8/NVFP4 GPT-2 checkpoints through
load_model end-to-end. Full suite: 870 passed (8 failures pre-exist on
main, verified against pristine checkout).

docs/theory_journal.md Appendices E-E2: engineering log of the 12
findings from implementation and real-checkpoint validation (nibble
order conventions, mixed-precision layouts, the 96GB OOM and the
chunked-unpack fix, transformers 5.x drift shims, Omni wrapper unwrap).
2026-08-16 12:11:12 -04:00
Brian Bell 62b006f6c4 feat: FP8 and NVFP4 checkpoint support (dequantize, surgery in float, BF16 output)
Point obliteratus at an FP8 or NVFP4 checkpoint and it just works:
the loader detects the format from config.json + safetensors metadata
(no weight loads), dequantizes shard-by-shard to a temporary BF16 copy,
then runs the normal float pipeline and saves BF16.

Supported layouts:
- FP8 DeepSeek-style block-wise (weight_scale_inv + weight_block_size)
- FP8 per-channel / per-tensor (compressed-tensors, ModelOpt)
- NVFP4 ModelOpt (uint8 nibbles + FP8 group scales + FP32 global),
  including MIXED_PRECISION checkpoints (FP8 mixer + NVFP4 experts)
- NVFP4 compressed-tensors (reciprocal scales)

Design:
- New pure-torch obliteratus/models/quant_dequant.py; no new deps.
  NVFP4 unpack uses torch.float4_e2m1fn_x2 when a runtime probe proves
  it works, else a chunked nibble LUT (bounds transient int64 index
  memory; a naive implementation OOMed at 96GB on a 30B model).
- Scale keys are dropped only when their base weight exists in the
  same shard, so legitimate params ending in _scale (logit_scale et al.)
  survive.
- Unsupported schemes (fbgemm, quanto, W4A4, ...) fail loudly at load,
  naming the scheme.
- Surgery guards: float8 or packed uint8 reaching _dequantize_weight or
  any fused-MoE path raises RuntimeError instead of silently upcasting
  (bitsandbytes quant_state params are explicitly excluded).
- Save path strips quantization metadata and logs that output is BF16;
  re-quantization for serving is out of scope (llm-compressor/modelopt).
- CLI: new --trust-remote-code flag; help text documents auto-detection.

Validated end-to-end on 1x A100-80GB (see PR description):
Nemotron-3-Nano-Omni-30B NVFP4 (mixed) and FP8, Qwen3-8B-FP8
(block-wise) vs Qwen3-8B BF16 baseline (perplexity 4.23 vs 4.33).
2026-08-16 12:11:07 -04:00
Brian Bell 84b97f6620 compat: transformers 5.x + custom-architecture loader shims, nemotron_h support
Loading custom-architecture checkpoints (Nemotron Omni family) against
transformers 5.14 surfaced API drift and wrapper mismatches:

- flash_attention_2 pinned in config but flash-attn not installed:
  recursively fall back to eager attention, incl. nested sub-configs
  (multimodal llm_config).
- all_tied_weights_keys shim: expected by the accelerate device-map
  integration and assigned by 5.x post_init, but absent on older remote
  code. Settable property aggregating legacy _tied_weights_keys,
  filtering keys that don't resolve on multimodal wrappers.
- prepare_inputs_for_generation: 5.x may pass cache_position=None;
  older remote code assumes a tensor. Wrap and synthesize it.
- Legacy list-style _tied_weights_keys normalized post-load so
  save_pretrained works (emptied when tie_word_embeddings is false).
- Multimodal wrappers whose forward() requires media inputs are
  unwrapped to their language_model submodule for text-only surgery.
- Register nemotron_h architecture (hybrid Mamba/attention/MoE, all
  layer content under layer.mixer) in strategies/utils.py.
2026-08-16 12:09:36 -04:00
Joseph Magly d4e029eb29 docs: publish Gate 3 final baseline 2026-08-16 10:48:21 -04:00
Joseph Magly 42b30f7e5b docs: record Gate 3 conditional evidence 2026-08-16 09:34:24 -04:00
Joseph Magly fa233fd8c9 ci: make CUDA conditional lane GPU-capable 2026-08-16 09:23:22 -04:00
Joseph Magly baf5331730 docs: align conditional claim boundary 2026-08-16 09:12:37 -04:00
Joseph Magly c90240f1e9 test: govern unavailable conditional environments 2026-08-16 09:05:41 -04:00
Joseph Magly b961623513 test: stabilize mature coverage across Python 2026-08-16 08:03:58 -04:00
Joseph Magly 04e757eda8 docs: record Gate 3 increment 7 evidence 2026-08-16 07:53:41 -04:00
Joseph Magly acc6b3b254 test: close Gate 3 tiny-runtime semantics 2026-08-16 07:53:00 -04:00
Joseph Magly 9683e0be4d docs: refresh Gate 3 item 6 audit evidence 2026-08-16 06:18:45 -04:00
Joseph Magly d299deb3a3 fix: contain Watchtower result downloads 2026-08-16 06:18:45 -04:00
Joseph Magly 659ff63f1e docs: record Gate 3 operator interface evidence 2026-08-16 06:18:45 -04:00
Joseph Magly bb84e55f77 test: cover tournament and operator UI contracts 2026-08-16 06:18:45 -04:00
Joseph Magly e8ac3b6567 chore: record AIWG 2026.8.11 deployment 2026-08-16 04:58:07 -04:00
Joseph Magly 3574800094 ci: enforce Ruff across all scripts 2026-08-16 03:49:09 -04:00
Joseph Magly aa182cc448 docs: reconcile item 5 audit evidence 2026-08-16 03:06:46 -04:00
Joseph Magly a1ec50ff77 fix: serialize watchtower state saves 2026-08-16 03:06:46 -04:00
Joseph Magly 98b0b78e90 docs: publish Gate 3 item 5 evidence 2026-08-16 03:06:46 -04:00
Joseph Magly 4026a6a118 test: close service boundary gaps 2026-08-16 03:06:46 -04:00
Joseph Magly a377ceefbd test: add service orchestration contracts 2026-08-16 03:06:46 -04:00
Joseph Magly 75219a0db3 docs: reconcile Gate 3 item 4 evidence 2026-08-16 03:06:46 -04:00
Joseph Magly d7d2ad566a docs: record Windows checkpoint repair evidence 2026-08-16 00:28:15 -04:00
Joseph Magly 3d2285be86 fix: use flushable checkpoint handles on Windows 2026-08-16 00:28:15 -04:00
Joseph Magly 2d803e6a1c ci: verify checkpoint portability on Windows 2026-08-16 00:28:15 -04:00
Joseph Magly c74538a2be test: harden checkpoint transaction reliability 2026-08-16 00:28:15 -04:00
Joseph Magly c1b34503dd docs: record Gate 3 loader decision evidence 2026-08-15 22:03:22 -04:00
Joseph Magly 41cb341405 test: close runtime decision mutation gaps 2026-08-15 22:03:22 -04:00
Joseph Magly 10685a53c2 test: enforce loader and weight decision contracts 2026-08-15 22:03:22 -04:00
Joseph Magly 2c2b38b501 docs: refresh Gate 3 repair evidence 2026-08-15 20:09:21 -04:00
Joseph Magly fbdc77172b test: stabilize coordinate permutation oracle 2026-08-15 20:09:21 -04:00
Joseph Magly 51529ad1d7 test: add Gate 3 numerical oracle contracts 2026-08-15 20:09:21 -04:00
Joseph Magly 369417fbb4 Record Gate 3 canonical evidence 2026-08-15 04:48:59 -04:00
Joseph Magly 256c39ea6a Own installed integration duration 2026-08-15 04:33:15 -04:00
Joseph Magly 753c53d07f Enforce Gate 3 test quality budgets 2026-08-15 04:33:15 -04:00
Joseph Magly 8456e52bf8 docs: define Gate 3 testing depth plan 2026-08-15 03:49:24 -04:00
Joseph Magly eab67c993d Test local RAM probe fallbacks
Cover broken psutil, Linux procfs fallback, macOS/POSIX sysconf fallback, and fail-closed behavior when every probe is unavailable.
2026-08-15 03:31:17 -04:00
Rachitt Shah 6c21ee243d Add a POSIX sysconf fallback for local RAM detection
Retain the unsuperseded macOS RAM-detection contribution from PR #13 while making every optional probe fail closed. The shared MPS device, loader, cache, and dtype work is already present on current main and is intentionally not duplicated.
2026-08-15 03:31:17 -04:00