v0.0.3
Added
-
Inference Serving:
- Production-ready REST API with FastAPI
- Streaming support via Server-Sent Events (SSE)
- Advanced sampling strategies (nucleus sampling/top-p, repetition penalty)
- Prometheus metrics endpoint for monitoring
- API key authentication (
X-API-Keyheader) - Structured logging with
python-json-logger - Real PyTorch model weights loading from checkpoint files
- Pickled tokenizer object loading support
-
Component Registry:
- Automatic component registration system (
ComponentRegistry) - Core components (MHA, MLP, MoE) auto-registered via side-effect imports
- Prevents "component not found" errors in simplified scripts
- Automatic component registration system (
-
Data Abstraction:
- Formalized
BaseTokenizerprotocol BaseDataModuleabstraction for flexible data handling- Environment variable configuration support (e.g.,
LLM_TRAINING__EPOCHS)
- Formalized
-
Testing & CLI:
--num-samplesflag intrain.pyfor rapid regression testing- Scheduler edge case tests (
test_scheduler_edge_cases.py) - Validation logging tests (
test_engine_logging.py) - Component registry tests (
test_init.py) - Model loading verification tests
- Auto-device detection in training scripts (prioritizes CUDA)
-
Documentation:
- Comprehensive usage guide (
docs/usage.md) - Architecture documentation (
docs/architecture.md) - Engineering documentation (ADRs, PR templates, FAQ)
- VS Code configuration and extensions
- Comprehensive usage guide (
Changed
-
Architecture Modernization:
- Migrated to Pydantic v2 (
BaseSettings,BaseModel) for configuration - Fully typed and validated configuration system
- CLI migration from
argparsetotyperfor better UX
- Migrated to Pydantic v2 (
-
Naming Standardization:
- Unified
ffn_hidden_size→intermediate_sizeacross codebase - Standardized input parameter
x→hidden_statesin forward methods - Applied to
MLP,LayerNorm,RMSNorm,DecoderModel,TransformerBlock - Updated all 309 tests to reflect API changes
- Unified
-
Code Quality:
- Standardized punctuation in documentation (full-width → half-width)
- Improved type hints and documentation comments
- Refactored
TransformerBlock.forwardfor clarity
Fixed
-
Core Bugs:
CosineAnnealingLRT_maxcalculation whenepochs == warmup_epochs(ZeroDivisionError)TrainingEnginevalidation logging crash whengradient_normsis empty (IndexError)- PAD token generation issue in inference (logits masking)
SyntheticDataModuleprefetch_factorhandling withnum_workers=0TransformerBlockshared norm instance bug (independentnorm1/norm2)- Scheduler/optimizer step order warnings in tests
- PositionalEncoding support for
start_posin incremental generation - MLP SwiGLU operation order for numerical consistency
- Prompt truncation respecting
max_seq_lenwith new tokens - Auto AMP dtype resolution for CPU-only environments
-
Registry & Imports:
- Package auto-registration via
import llm - Component not found errors in simplified execution
- Package auto-registration via