Understand the TorchSpec package layout
mainTorchSpec is organized into several functional domains to support asynchronous training and inference pipelines:
config/: Hierarchical configuration using OmegaConf (e.g.,train_config.py,inference_config.py).ray/: Ray infrastructure for GPU setup and resource management.controller/: Orchestration of the async pipeline viaAsyncTrainingControllerandAsyncInferenceManager.inference/: Inference engine layer providing unified interfaces forHFEngine,SglEngine, andVllmEngine.models/: Model definitions includingdraft/(lightweight transformers),target/(target model abstractions), andops/(custom operations like KL loss).training/: Training logic includingTrainerActor(Ray actor),Eagle3Trainer, and FSDP2 helpers.transfer/mooncake/: Distributed tensor transfer using Mooncake for multi-node RDMA-based communication.data/: Data pipelines for loading, parsing, and preprocessing datasets.utils/: Shared utilities for distributed setup, logging, and memory estimation.