ViperEkura
4244df2785
perf: pure FP8 fwd/bwd and lean non-transposed GEMM
...
- drop the fused kernel; forward/backward are quantize + a pre-quantized GEMM
- rename module fp8_mm -> fp8_ops (mm.cu -> ops.cu)
- kernels/launchers fp8_gemm_kernel / launch_fp8_gemm; drop PqTraits/gather_trans/pack_fp8x4_vector
- remove the in-kernel transposed-operand branches (TransA/TransB)
- backward: quantize g once (amax_g here), explicit fp8 transposes, fast non-transposed GEMMs (dX = g@w^T, dW = g^T@x^T)
- each pass uses a single FP8 format (E4M3 fwd / E5M2 bwd)
2026-08-23 15:38:30 +08:00
ViperEkura
75304d084d
refactor: unify CUDA skip guards in tests
...
- add skip_no_fp8 (CUDA + fp8_mm kernel + cc 8.9+) to tests/conftest.py
- use skip_no_cuda / skip_no_kernel / skip_no_fp8 directly in test modules
- drop _GPU alias and tests.extension.conftest re-exports
- remove unused imports (Union in hf_adapter, make_grpo_config in data conftest)
2026-08-22 21:08:06 +08:00
ViperEkura
dcc96de12a
test: refactor tests and fix inference edge cases
...
- Convert protocol and MoE test classes to plain functions
- Add real server/engine integration and generate_async tests
- Isolate test model per test and use pytest tmp_path
- Reset FastAPI engine state after inference tests
- Fix generate_async StopIteration handling on Python 3.12
- Fix HF adapter MoE dense/shared and Gemma qk_norm mapping
- Correct dev dependency httpx2 to httpx
2026-08-21 22:59:51 +08:00
ViperEkura
84753d3e08
refactor: deduplicate and restructure test suite
...
- extract preprocessing config factories into tests/data/factories.py
- keep conftest.py fixtures-only; stop importing builders from it
- promote temp_dir fixture to root conftest for cross-directory reuse
- unify duplicate BPE tokenizer builders into build_test_tokenizer
- merge grpo/dpo online e2e tests into one parametrized integration test
- extract engine mock factory and shared model batch builders
- drop local tempfile usage in favor of shared fixtures
No behavior change: 519 tests pass.
2026-08-20 01:53:28 +08:00
ViperEkura
738cb8f128
fix: broadcast ref/old model state_dict for FSDP
...
- Add broadcast_state_dict to sync state_dict from rank-0 to all ranks
- Fix create_ref_model returning None on non-rank-0 under FSDP
- Fix sync_old_model only updating old_model on rank-0 under FSDP
- Split skip_no_cuda/skip_no_kernel markers and hoist to top-level conftest
- Add distributed tests for broadcast_state_dict and create_ref_model
2026-07-31 08:32:22 +08:00
ViperEkura
5ba21f4eb3
refactor: eliminate test duplication via shared helpers
...
- Add tests/helpers.py with shared config, dataset, tokenizer, executor, and assertion helpers
- Replace 15 copies of device one-liner with session-scoped fixture
- Collapse 5 near-identical Dataset subclasses into RandomTokenDataset
- Remove duplicate _make_config/_make_model/_make_frozen and FakeTokenizer/FakeExecutor definitions
- Make test_callbacks and test_early_stopping use existing train_config_factory
- Replace 6 duplicate meta.json read blocks with load_shard_meta
- Fix mkdtemp leaks in test_lora.py with TemporaryDirectory
2026-07-27 22:34:53 +08:00
ViperEkura
0c86c89af4
refactor : align config field names with Hugging Face
...
- dim -> hidden_size, n_layers -> num_hidden_layers
- dim_ffn -> intermediate_size, n_heads -> num_attention_heads
- n_kv_heads -> num_key_value_heads, max_len -> max_position_embeddings
- norm_eps -> rms_norm_eps, tie_weight -> tie_word_embeddings
- update model, inference, training, scripts, tests, docs
2026-07-20 22:05:31 +08:00
ViperEkura
aabb0d83e9
refactor : replace iteration with consumed_samples
...
- Replace context.iteration with consumed_samples (global sample count)
- Add optimizer_step property derived from consumed_samples
- Checkpoint meta.json stores consumed_samples, drops iteration
- CLI --start_batch renamed to --start_samples (per-rank samples)
- Checkpoint dir naming: epoch_X_step_Y instead of epoch_X_iter_Y
- Metric log entries use step and consumed_samples fields
- Backward compat removed (old iteration checkpoints unsupported)
2026-06-30 18:42:42 +08:00
ViperEkura
97c7ac0f4f
refactor: Transformer更名为AutoRegressiveLM并新增EmbeddingEncoder
...
- AutoRegressiveLM 注册名改为 autoregressive_lm
- 新增 EmbeddingEncoder 支持 mean/cls/last pooling
- ModelConfig 增加 pooling_type / normalize_embeddings 字段
- 导入、注释、测试全部同步更新
2026-05-17 15:29:20 +08:00
ViperEkura
0ba8c70ce1
fix: 修复 MLA 多个 bug 并缩小测试模型参数
...
- MLA kv_b_proj 输出维度和 q_rope 切分偏移修复
- 打通 MLA 配置从 ModelConfig 到 DecoderBlock 的传递路径
- rope_theta 配置不再被忽略,MLA 使用 qk_rope_head_dim
- tie_weight 使用 is True 避免 None 隐式生效
- norm_eps/rope base 类型标注修正
- 测试模型参数缩小 (dim=8, head_dim=4)
- 新增 6 种架构配置 × 2 场景的前向传播测试
2026-05-16 14:57:43 +08:00
ViperEkura
5203b7f53e
perf: 测试优化,model 改为 session 共享,scheduler 用 Event 替代 sleep
...
- 拆出 session-scoped test_tokenizer + test_model,14 次创建 → 1 次
- 删除无用 test_env fixture
- 固定模型维度,消除随机性
- 添加 pytest markers 配置
2026-05-12 11:35:18 +08:00
ViperEkura
ace8f6ee68
chore: 优化未使用的模块
2026-04-06 09:54:17 +08:00
ViperEkura
39766aa1dc
chore: 修改类名,优化导入顺序
2026-04-05 22:27:57 +08:00
ViperEkura
c94a246c71
chore: 重命名目录
2026-04-04 17:03:22 +08:00
ViperEkura
bd9741dc5f
refactor: 从data 模块分离tokenizer
2026-04-04 16:12:58 +08:00
ViperEkura
0852b852f8
refactor: 优化参数传递,清理导入样式
2026-04-03 22:06:32 +08:00
ViperEkura
3a7d98a950
fix: 修复测试部分导入问题
2026-04-03 15:01:39 +08:00
ViperEkura
475de51c7d
feat: 增加server, 并且修改测试单元
2026-04-02 15:05:07 +08:00
ViperEkura
2e009cf59a
chore: 更新项目名称
2026-03-31 09:34:11 +08:00
ViperEkura
426af2d75f
style: 使用ruff 工具优化代码风格
2026-03-30 23:32:28 +08:00
ViperEkura
345fd2f091
fix: 修复参数传递问题
2026-03-30 22:22:36 +08:00
ViperEkura
5713b55500
refactor: 修改 StepMonitorCallback, 分离职责
2026-03-04 19:45:39 +08:00
ViperEkura
eba99e1f5e
feat(model): 添加QK归一化和门控注意力支持
2026-01-05 16:14:44 +08:00
ViperEkura
3ee84b31a0
feat(data): 重构数据集加载逻辑,修复计数错误
2025-11-28 20:59:24 +08:00
ViperEkura
7e5ecf3b7d
refactor(config): 重命名 TransformerConfig 为 ModelConfig
2025-11-07 07:31:12 +08:00
ViperEkura
d94fc5a87a
feat(data, inference): 使用chatML格式
2025-10-29 12:02:43 +08:00
ViperEkura
c51b203fde
refactor(khaosz): 重构项目结构
2025-10-18 13:56:59 +08:00
ViperEkura
9d5aa952e0
feat(tests): 重构测试环境, 便于pickle 序列化
2025-10-04 21:31:39 +08:00
ViperEkura
e7d29ca2d5
feat(tests): 改进测试环境配置与设备管理
2025-10-04 12:12:42 +08:00
ViperEkura
85aeec9e55
test(conftest): 添加matplotlib后端设置以避免GUI问题
2025-10-03 22:11:54 +08:00
ViperEkura
28b01220b6
test(trainer): 拆分测试文件
2025-10-03 22:08:11 +08:00