| Crates.io | torsh-jit |
| lib.rs | torsh-jit |
| version | 0.1.0-alpha.2 |
| created_at | 2025-09-30 02:03:45.223494+00 |
| updated_at | 2025-12-22 04:59:27.705465+00 |
| description | JIT compilation and kernel fusion for ToRSh deep learning framework |
| homepage | https://github.com/cool-japan/torsh/ |
| repository | https://github.com/cool-japan/torsh/ |
| max_upload_size | |
| id | 1860478 |
| size | 1,881,708 |
Just-In-Time (JIT) compilation and kernel fusion for the ToRSh deep learning framework.
The torsh-jit crate provides JIT compilation capabilities for ToRSh, enabling:
use torsh_jit::{JitCompiler, JitConfig, FusionStrategy};
// Configure JIT compilation
let config = JitConfig {
fusion_strategy: FusionStrategy::Default,
enable_optimizations: true,
max_fusion_size: 8,
enable_profiling: false,
target_device: Device::Cpu,
enable_caching: true,
};
// Create JIT compiler
let mut compiler = JitCompiler::new(config);
// Build computation graph (usually from a model)
let graph = build_model_graph();
// Compile the graph
let compiled_module = compiler.compile(graph)?;
// Execute with inputs
let outputs = compiled_module.execute(&inputs)?;
// Get execution statistics
let stats = compiled_module.stats();
println!("Execution time: {}μs", stats.total_time_us);
The core representation is a directed acyclic graph (DAG) where:
The fusion engine identifies patterns of operations that can be combined:
Multiple optimization passes are applied in sequence:
Backend-specific code generators produce optimized kernels:
The JIT compiler can provide significant speedups by:
Typical improvements:
Licensed under either of:
at your option.