trnrt 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trnrt-0.2.0/trnrt.egg-info → trnrt-0.3.0}/PKG-INFO +52 -36
- {trnrt-0.2.0 → trnrt-0.3.0}/README.md +51 -35
- {trnrt-0.2.0 → trnrt-0.3.0}/pyproject.toml +5 -1
- trnrt-0.3.0/tests/test_benchmark_mode.py +143 -0
- trnrt-0.3.0/tests/test_benchmarks.py +839 -0
- trnrt-0.3.0/tests/test_benchmarks_needle.py +537 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_builds.py +15 -0
- trnrt-0.3.0/tests/test_deepseek_v41.py +351 -0
- trnrt-0.3.0/tests/test_deepseek_v41_chat.py +272 -0
- trnrt-0.3.0/tests/test_deepseek_v41_engine.py +698 -0
- trnrt-0.3.0/tests/test_deepseek_v41_engram.py +333 -0
- trnrt-0.3.0/tests/test_deepseek_v41_model.py +577 -0
- trnrt-0.3.0/tests/test_deepseek_v41_reference.py +256 -0
- trnrt-0.3.0/tests/test_deepseek_v41_released.py +264 -0
- trnrt-0.3.0/tests/test_dsv41_ckpt.py +293 -0
- trnrt-0.3.0/tests/test_dsv41_ckpt_synth.py +671 -0
- trnrt-0.3.0/tests/test_dsv41_mxfp4.py +253 -0
- trnrt-0.3.0/tests/test_engine_kv_only.py +142 -0
- trnrt-0.3.0/tests/test_glm53_full_template.py +132 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_config.py +235 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_engine.py +77 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_ep.py +166 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_layers.py +247 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_model.py +391 -0
- trnrt-0.3.0/tests/test_glm_moe_dsa_topk.py +97 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_arena.py +16 -0
- trnrt-0.3.0/tests/test_model_families.py +84 -0
- trnrt-0.3.0/tests/test_moe_ep.py +788 -0
- trnrt-0.3.0/tests/test_parsers_deepseek.py +265 -0
- trnrt-0.3.0/tests/test_parsers_qwen3.py +230 -0
- trnrt-0.3.0/tests/test_parsers_qwen38.py +166 -0
- trnrt-0.3.0/tests/test_qwen3_5_checkpoint.py +188 -0
- trnrt-0.3.0/tests/test_qwen3_5_engine.py +119 -0
- trnrt-0.3.0/tests/test_qwen3_5_kernel_route.py +65 -0
- trnrt-0.3.0/tests/test_qwen3_5_layers.py +273 -0
- trnrt-0.3.0/tests/test_qwen3_5_model.py +233 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_release_plan.py +1 -1
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_router.py +20 -1
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_router_native.py +87 -3
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_anthropic.py +25 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_api.py +27 -2
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_cli.py +32 -1
- trnrt-0.3.0/tests/test_serve_families.py +313 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_native.py +106 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_responses.py +12 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_sampling.py +159 -2
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_tp_stop_bound.py +273 -3
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/__init__.py +1 -1
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/__main__.py +45 -6
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/engine.py +53 -18
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/host_arena.py +6 -1
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/scheduler.py +24 -11
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/tp.py +59 -1
- trnrt-0.3.0/trnrt/kernels/moe_ep.py +1278 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/metrics.py +9 -6
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/config.py +8 -1
- trnrt-0.3.0/trnrt/models/deepseek_v41.py +417 -0
- trnrt-0.3.0/trnrt/models/dsv41_attn.py +526 -0
- trnrt-0.3.0/trnrt/models/dsv41_ckpt.py +1074 -0
- trnrt-0.3.0/trnrt/models/dsv41_engine.py +728 -0
- trnrt-0.3.0/trnrt/models/dsv41_engram.py +536 -0
- trnrt-0.3.0/trnrt/models/dsv41_model.py +684 -0
- trnrt-0.3.0/trnrt/models/dsv41_mxfp4.py +152 -0
- trnrt-0.3.0/trnrt/models/dsv41_quant.py +80 -0
- trnrt-0.3.0/trnrt/models/families.py +61 -0
- trnrt-0.3.0/trnrt/models/gdn.py +363 -0
- trnrt-0.3.0/trnrt/models/glm_moe_dsa.py +519 -0
- trnrt-0.3.0/trnrt/models/gqa.py +142 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/loader.py +10 -1
- trnrt-0.3.0/trnrt/models/mla_rope.py +255 -0
- trnrt-0.3.0/trnrt/models/plain.py +443 -0
- trnrt-0.3.0/trnrt/models/qwen3_5.py +203 -0
- trnrt-0.3.0/trnrt/models/topk.py +114 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/anthropic.py +11 -1
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/api.py +261 -78
- trnrt-0.3.0/trnrt/serve/benchmark_mode.py +77 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/native.py +50 -18
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/parsers.py +349 -46
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/responses.py +7 -4
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/router.py +54 -8
- {trnrt-0.2.0 → trnrt-0.3.0/trnrt.egg-info}/PKG-INFO +52 -36
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt.egg-info/SOURCES.txt +50 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/LICENSE +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/NOTICE +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/setup.cfg +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api_cached_tokens.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api_engine_health.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api_native.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api_prompt_thread.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_api_request_checks.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_cache_overlap_pages.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_check_docs.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_check_image.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_check_mixed.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ckpt_dominated.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ckpt_mid.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ckpt_mid_export.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ckpt_offload_running.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ckpt_prompt_finish.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_compile_farm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_decode_composition.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_decode_route_modules.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_detok_incremental.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_detok_selfcheck.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dma_hw.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_cp.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_cp_glue.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_cp_index_rows.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_fail_attn_trip.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_fail_trip.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_fused_layer.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_index.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_long.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_long_select_t_trips.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_merge_rbits.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_odec_drop.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_routes.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_row_classes.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_sel2g_generated.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_slots.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_slots_n_p.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_snd.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_tieskip.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_dsa_topk.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_e2e.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_engine_priority.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ffn_half.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_ffn_half_ids1.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_gated_norm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_glm53_chat.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_glm53_template.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_glm5_next.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_grammar_engine.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_graph_equiv.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_graph_equiv_command.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_graph_equiv_meta.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_guided_host.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_cache_batch.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_cache_checkpoints.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_cache_save_once.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_sampling_engine.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_sampling_units.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_sampling_warmup.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_host_sim_seam.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_iopool.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda_decode.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda_routes.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda_shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda_shell_verify.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_kda_zero_row.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_labeler.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_lnc_split.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_local_k.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_log.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_max_running.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_mhc.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_mhc_seam.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_mk_b5c.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_mk_kda_layer.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_model_path.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_moe_dedupe.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_moe_prefill.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_moe_prefill_mdr.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_moe_prefill_tsb.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_neff_strip.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_no_abbrev.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_no_trace.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_numa_pin.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_parsers.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_parsers_glm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_preset_env.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_prompt_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_radix_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_radix_eviction.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_rank_threads.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_router_affinity.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_row_isolation.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_rowclass_runner.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_sampler.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_sched_cli.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_sched_pchain.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_scheduler.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_scheduler_policy.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_scheduler_spec.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_e2e.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_sched.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_stats.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_serve_structured.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_shape_dir_hub.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_sp_gather_direct.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_async.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_config.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_engine_fake.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_metrics.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_model.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_runner_stub.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_spec_synth.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_start_checks.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_state_pool.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_state_pool_spec.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_third_party_notices.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_tp_init.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_tp_shm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/tests/test_zero_blobs.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/compile/__init__.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/compile/cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/compile/capture.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/compile/farm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/compile/strip.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/config.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/__init__.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/grammar.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/guided.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/host_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/host_inputs.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/iopool.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/kv_pool.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/model_runner.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/radix_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/request.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/sampler.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/spec_async.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/spec_synth.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/start_checks.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/start_lock.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/state_pool.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/engine/watchdog.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/__init__.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/cc_tail.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/cc_world.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/delta_rule.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dense_half.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_cp_glue.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_decode.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_index.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_long_pipe.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_long_pipe_s.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_long_select.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_long_select_t.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_sa.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_sat.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_satwf.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_satwfc.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_satwfcg.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_satwfcga.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_satwfg.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_sel2g.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_sel2gc.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_sel_s2.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots_c.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots_n.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots_n_p.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots_n_s.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_slots_n_s2.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_topk.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/dsa_topk_t.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/ffn_half.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/ffn_half_pb.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/ffn_half_shared.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/gated_norm.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/kda_decode.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/kda_half.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/kda_oob.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/kda_shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_fnj.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_front.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_mix.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_pre.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_pre_split.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_seam.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mhc_split.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mix_wide.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/mk_kda_layer.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/moe_dedupe.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/moe_half.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/moe_prefill.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/moe_prefill_mdr.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/moe_prefill_tsb.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/rowiso.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/shell.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/short_conv.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/kernels/sp_gather.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/log.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/__init__.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/decoder.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/dsa_long.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/dsa_select.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/glm5_next.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/hybrid.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/linear_attn.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/mla.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/models/quant.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/platform.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/__init__.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/dashboard.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/prodlog.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/prompt_cache.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/stats.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt/serve/structured.py +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt.egg-info/dependency_links.txt +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt.egg-info/entry_points.txt +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt.egg-info/requires.txt +0 -0
- {trnrt-0.2.0 → trnrt-0.3.0}/trnrt.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trnrt
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: LLM inference on AWS Trainium2, with NKI megakernels: an OpenAI-compatible server, 1M-token context and prefix caching
|
|
5
5
|
Author-email: RunAnywhere <security@runanywhere.ai>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -73,7 +73,8 @@ Dynamic: license-file
|
|
|
73
73
|
|
|
74
74
|
**TrnRT** is an open inference engine for large language models on AWS Trainium. It serves an OpenAI-compatible API
|
|
75
75
|
from one `trn2.48xlarge`, runs decode as NKI megakernels (about one kernel per layer half), and keeps a prefix cache
|
|
76
|
-
across device and host memory. **GLM-5.3-Flash is the first supported model
|
|
76
|
+
across device and host memory. **GLM-5.3-Flash is the first supported model. Qwen3.8-27B, GLM-5.3 and DeepSeek-V4.1-Flash are experimental:
|
|
77
|
+
CPU-verified, not yet run on Trainium2.**
|
|
77
78
|
|
|
78
79
|
How we built it, with the AgentX results: [Serving GLM-5.3-Flash on one Trainium2 box with NKI layer megakernels](https://runanywhere.ai/blog/glm-5-3-flash-trainium2-nki-megakernels).
|
|
79
80
|
|
|
@@ -91,47 +92,52 @@ How we built it, with the AgentX results: [Serving GLM-5.3-Flash on one Trainium
|
|
|
91
92
|
<picture>
|
|
92
93
|
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/standing-dark.svg">
|
|
93
94
|
<source media="(prefers-color-scheme: light)" srcset="docs/assets/standing-light.svg">
|
|
94
|
-
<img alt="1.6 to 1.
|
|
95
|
+
<img alt="1.6 to 1.9 times H200's tokens per dollar at 1, 4 and 8 users (MTP at InferenceX's golden acceptance length) and 1.09 times at 16, and 3.9 to 5.2 times H100's at 16, 24 and 32 users: InferenceX AgentX, one TrnRT engine of 8 Trainium2 chips against one 8-GPU node, at AWS Capacity Block prices." src="docs/assets/standing-dark.svg" width="100%">
|
|
95
96
|
</picture>
|
|
96
97
|
</p>
|
|
97
98
|
|
|
98
|
-
On [InferenceX](https://github.com/SemiAnalysisAI/InferenceX) AgentX, which replays real coding-agent sessions, one
|
|
99
|
-
engine (8 Trainium2 chips, half a `trn2.48xlarge`) delivers more tokens per dollar than one 8-GPU H200 node
|
|
100
|
-
concurrent users, and 3.
|
|
101
|
-
|
|
99
|
+
On [InferenceX](https://github.com/SemiAnalysisAI/InferenceX) AgentX, which replays real coding-agent sessions, one
|
|
100
|
+
TrnRT engine (8 Trainium2 chips, half a `trn2.48xlarge`) delivers more tokens per dollar than one 8-GPU H200 node at 1,
|
|
101
|
+
4, 8 and 16 concurrent users, and 3.9-5.2× an H100 node's at 16, 24 and 32 users. At 1, 4 and 8 users it runs the
|
|
102
|
+
`latency-golden` build: MTP speculation at InferenceX's golden acceptance length (2.519), the benchmark mode, whose
|
|
103
|
+
output text is not the model's. Both columns of those rows, tokens per dollar and tok/s per user, are at that synthetic
|
|
104
|
+
acceptance (as H200's are at theirs), so they compare speed, never output quality. All three run GLM-5.3-Flash's FP8
|
|
105
|
+
weights and are priced at AWS's Capacity Block list prices.
|
|
102
106
|
|
|
103
107
|
<p align="center">
|
|
104
108
|
<picture>
|
|
105
109
|
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/results-agentx-users-dark.png">
|
|
106
110
|
<source media="(prefers-color-scheme: light)" srcset="docs/assets/results-agentx-users-light.png">
|
|
107
|
-
<img alt="AgentX total tokens per dollar by concurrent users: trn2 above H200
|
|
111
|
+
<img alt="AgentX total tokens per dollar by concurrent users: trn2 above H200 at 1, 4, 8 and 16 users and above H100 at every measured concurrency, at AWS Capacity Block prices." src="docs/assets/results-agentx-users-dark.png" width="760">
|
|
108
112
|
</picture>
|
|
109
113
|
</p>
|
|
110
114
|
|
|
111
|
-
| Users | Tokens per $: trn2 ÷ H200 | Tokens per $: trn2 ÷ H100 | P90 interactivity, tok/s per user: trn2 / H200 |
|
|
112
|
-
|
|
113
|
-
| 1 | **1.
|
|
114
|
-
| 4 | **1.
|
|
115
|
-
| 8 | **1.
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
trn2 delivers 0.
|
|
115
|
+
| Users | trn2 build | Tokens per $: trn2 ÷ H200 | Tokens per $: trn2 ÷ H100 | P90 interactivity, tok/s per user: trn2 / H200 |
|
|
116
|
+
|---|---|---|---|---|
|
|
117
|
+
| 1 | `latency-golden` | **1.73×** | **1.60×** | 66.3 / 272 |
|
|
118
|
+
| 4 | `latency-golden` | **1.89×** | **1.88×** | 51.3 / 235 |
|
|
119
|
+
| 8 | `latency-golden` | **1.63×** | **2.02×** | 27.6 / 168 |
|
|
120
|
+
| 16 | `balanced` | **1.09×** | **3.89×** | 14.2 / 87.8 |
|
|
121
|
+
| 24 | `throughput` | 0.87× | **5.17×** | 11.5 / 78.7 |
|
|
122
|
+
| 32 | `throughput` | 0.81× | **4.95×** | 10.7 / 50.1 |
|
|
123
|
+
|
|
124
|
+
**Where we're behind.** Each trn2 user is slower: P90 interactivity (1 / the P90 inter-token latency, as InferenceX
|
|
125
|
+
plots it; the wait for the first token is not in it) is 10.7-66.3 tok/s per user against H200's 50.1-272 (at 1-8
|
|
126
|
+
users both at synthetic golden acceptance). At 24 and 32 users H200 delivers more tokens per dollar (0.81-0.87×), and on
|
|
127
|
+
the 8K/1K fixed-length recipe, whose prompts share no prefix (its client's warmup sends the first timed prompt, so one
|
|
128
|
+
timed request per run can find it cached), trn2 delivers 0.89-1.00× H200's at 1-8 users and 0.52-0.82× at 16-64. Where a decode step's time goes is in
|
|
125
129
|
[docs/RESULTS.md](docs/RESULTS.md#where-a-decode-steps-time-goes).
|
|
126
130
|
|
|
127
131
|
<sub>InferenceX AgentX harness 1.0.12, canonical workload, one hour per point; ratios compare the same concurrency. The
|
|
128
|
-
1-8 user points use MTP at InferenceX's golden acceptance length (2.519; trn2's measured acceptance is 2.20)
|
|
129
|
-
AWS Capacity Blocks list, read 24 Nov 2026:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
1-8 user points use MTP at InferenceX's golden acceptance length (2.519; trn2's measured acceptance is 2.20): the
|
|
133
|
+
`latency-golden` build, whose output text is not the model's. Prices, AWS Capacity Blocks list, read 24 Nov 2026:
|
|
134
|
+
trn2.48xlarge $2.235 per Trainium2 chip-hour ($35.76 per instance-hour), p5.48xlarge $5.970 per H100-hour, p5e.48xlarge
|
|
135
|
+
$6.866 per H200-hour. Every trn2 point is a run of 0.2.0's code with the serve fixes, on 25 Nov 2026 (the 2.20
|
|
136
|
+
acceptance dates from 0.2.0), with
|
|
137
|
+
[benchmarks/](benchmarks/README.md) (the image from `docker/Dockerfile`, Neuron SDK 2.32, and a compile cache built from
|
|
138
|
+
source). GSM8K is 97.4-97.6% on the builds served with real acceptance (strict exact match, 5-shot, all 1,319 problems),
|
|
139
|
+
and each passed a needle test (on its answers; a host-tier restore is not observable on this server). GPU numbers are
|
|
140
|
+
InferenceX's public runs; we report no accuracy score for them and did not check them. Every table, source run and the method:
|
|
135
141
|
[docs/RESULTS.md](docs/RESULTS.md#against-h100-and-h200-inferencex-agentx-and-8k1k).</sub>
|
|
136
142
|
|
|
137
143
|
## Highlights
|
|
@@ -220,10 +226,15 @@ The full guide covers what each step needs, start-up checks, the three builds an
|
|
|
220
226
|
|---|---|
|
|
221
227
|
| **AWS Trainium2**, `trn2.48xlarge` (16 chips, 2 engines × TP 32, LNC 2) | ✅ Supported |
|
|
222
228
|
| **[GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)** (320B MoE, 18B active, FP8, 1M-token context) | ✅ Supported |
|
|
229
|
+
| **[Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)** (dense, Gated DeltaNet and gated attention, BF16) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
230
|
+
| **[GLM-5.3](https://huggingface.co/zai-org/GLM-5.3)** (MoE, latent attention with a sparse indexer, FP8) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
231
|
+
| **[DeepSeek-V4.1-Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash)** (MoE with MXFP4 experts, compressed sparse attention, Engram) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
223
232
|
| More open models | 🔜 Coming soon. [Request a model](https://github.com/RunanywhereAI/trnrt/issues/new?template=30-model-request.yml) |
|
|
224
233
|
|
|
225
|
-
GLM-5.3-Flash is where TrnRT starts.
|
|
226
|
-
|
|
234
|
+
GLM-5.3-Flash is where TrnRT starts. An experimental model's code is in the tree and matches an upstream reference on
|
|
235
|
+
CPU on reduced configurations, but it has not run on Trainium2 here and no device number is claimed for it: [docs/MODELS.md](docs/MODELS.md)
|
|
236
|
+
says what each one has and what it still needs. [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#adding-a-model-family)
|
|
237
|
+
describes what a new model family needs.
|
|
227
238
|
|
|
228
239
|
## Benchmarks
|
|
229
240
|
|
|
@@ -241,14 +252,18 @@ at $35.76/h, the batch 12 cost is $0.167 per million tokens. Full tables, cold-p
|
|
|
241
252
|
methodology are in [docs/RESULTS.md](docs/RESULTS.md).
|
|
242
253
|
|
|
243
254
|
These numbers were measured with an earlier build of TrnRT, at release 0.1.0's batch presets, which this release's
|
|
244
|
-
builds replace.
|
|
255
|
+
builds replace. At release 0.1.0, this repository passed these checks against that build
|
|
245
256
|
([docs/KNOWN_ISSUES.md](docs/KNOWN_ISSUES.md#verification-status)):
|
|
246
257
|
|
|
247
|
-
- Graph equivalence: EQUAL on all 32 ranks, for all 157 graphs that build compiles in
|
|
258
|
+
- Graph equivalence: EQUAL on all 32 ranks, for all 157 graphs that build compiles in its default batch-12
|
|
248
259
|
configuration.
|
|
249
260
|
- Outputs: byte-identical to that build's on 384 of 384 requests.
|
|
250
|
-
- Serving: the two-engine serve in the [Quickstart](#quickstart) passed end to end on the device
|
|
251
|
-
|
|
261
|
+
- Serving: the two-engine serve in the [Quickstart](#quickstart) passed end to end on the device.
|
|
262
|
+
|
|
263
|
+
On 0.2.0's code with the serve fixes (24-25 Nov 2026), the builds read EQUAL against their reference builds, with
|
|
264
|
+
bitwise-equal outputs on the device, and the comparison with H100 and H200 above is a run of that code. 0.3.0 then
|
|
265
|
+
added the experimental model families, with a dispatch in two traced files: none of these checks, nor the two-engine
|
|
266
|
+
serve, has run on the device for 0.3.0 yet ([KNOWN_ISSUES.md](docs/KNOWN_ISSUES.md#verification-status)).
|
|
252
267
|
|
|
253
268
|
## How it works
|
|
254
269
|
|
|
@@ -271,11 +286,12 @@ trnrt/
|
|
|
271
286
|
├── __main__.py CLI: serve, engine, compile
|
|
272
287
|
├── serve/ OpenAI API, session-affine router, output parsers
|
|
273
288
|
├── engine/ scheduler, prefix caches, tensor parallelism
|
|
274
|
-
├── models/ GLM-5.3-Flash: KDA, DSA, mHC, MoE, FP8 loading
|
|
289
|
+
├── models/ GLM-5.3-Flash: KDA, DSA, mHC, MoE, FP8 loading; the experimental families
|
|
275
290
|
├── kernels/ NKI decode megakernels and prefill kernels
|
|
276
291
|
└── compile/ offline compile: shapes, capture, neuronx-cc, strip
|
|
277
292
|
docker/ the serving and compile image
|
|
278
293
|
tools/ graph-equivalence gate, device checks, doc checks
|
|
294
|
+
benchmarks/ the recipe for every published point: builds, clients, scorers, accuracy
|
|
279
295
|
tests/ CPU test suite (no NeuronCore needed)
|
|
280
296
|
docs/ guides, results, kernel notes
|
|
281
297
|
```
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
**TrnRT** is an open inference engine for large language models on AWS Trainium. It serves an OpenAI-compatible API
|
|
28
28
|
from one `trn2.48xlarge`, runs decode as NKI megakernels (about one kernel per layer half), and keeps a prefix cache
|
|
29
|
-
across device and host memory. **GLM-5.3-Flash is the first supported model
|
|
29
|
+
across device and host memory. **GLM-5.3-Flash is the first supported model. Qwen3.8-27B, GLM-5.3 and DeepSeek-V4.1-Flash are experimental:
|
|
30
|
+
CPU-verified, not yet run on Trainium2.**
|
|
30
31
|
|
|
31
32
|
How we built it, with the AgentX results: [Serving GLM-5.3-Flash on one Trainium2 box with NKI layer megakernels](https://runanywhere.ai/blog/glm-5-3-flash-trainium2-nki-megakernels).
|
|
32
33
|
|
|
@@ -44,47 +45,52 @@ How we built it, with the AgentX results: [Serving GLM-5.3-Flash on one Trainium
|
|
|
44
45
|
<picture>
|
|
45
46
|
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/standing-dark.svg">
|
|
46
47
|
<source media="(prefers-color-scheme: light)" srcset="docs/assets/standing-light.svg">
|
|
47
|
-
<img alt="1.6 to 1.
|
|
48
|
+
<img alt="1.6 to 1.9 times H200's tokens per dollar at 1, 4 and 8 users (MTP at InferenceX's golden acceptance length) and 1.09 times at 16, and 3.9 to 5.2 times H100's at 16, 24 and 32 users: InferenceX AgentX, one TrnRT engine of 8 Trainium2 chips against one 8-GPU node, at AWS Capacity Block prices." src="docs/assets/standing-dark.svg" width="100%">
|
|
48
49
|
</picture>
|
|
49
50
|
</p>
|
|
50
51
|
|
|
51
|
-
On [InferenceX](https://github.com/SemiAnalysisAI/InferenceX) AgentX, which replays real coding-agent sessions, one
|
|
52
|
-
engine (8 Trainium2 chips, half a `trn2.48xlarge`) delivers more tokens per dollar than one 8-GPU H200 node
|
|
53
|
-
concurrent users, and 3.
|
|
54
|
-
|
|
52
|
+
On [InferenceX](https://github.com/SemiAnalysisAI/InferenceX) AgentX, which replays real coding-agent sessions, one
|
|
53
|
+
TrnRT engine (8 Trainium2 chips, half a `trn2.48xlarge`) delivers more tokens per dollar than one 8-GPU H200 node at 1,
|
|
54
|
+
4, 8 and 16 concurrent users, and 3.9-5.2× an H100 node's at 16, 24 and 32 users. At 1, 4 and 8 users it runs the
|
|
55
|
+
`latency-golden` build: MTP speculation at InferenceX's golden acceptance length (2.519), the benchmark mode, whose
|
|
56
|
+
output text is not the model's. Both columns of those rows, tokens per dollar and tok/s per user, are at that synthetic
|
|
57
|
+
acceptance (as H200's are at theirs), so they compare speed, never output quality. All three run GLM-5.3-Flash's FP8
|
|
58
|
+
weights and are priced at AWS's Capacity Block list prices.
|
|
55
59
|
|
|
56
60
|
<p align="center">
|
|
57
61
|
<picture>
|
|
58
62
|
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/results-agentx-users-dark.png">
|
|
59
63
|
<source media="(prefers-color-scheme: light)" srcset="docs/assets/results-agentx-users-light.png">
|
|
60
|
-
<img alt="AgentX total tokens per dollar by concurrent users: trn2 above H200
|
|
64
|
+
<img alt="AgentX total tokens per dollar by concurrent users: trn2 above H200 at 1, 4, 8 and 16 users and above H100 at every measured concurrency, at AWS Capacity Block prices." src="docs/assets/results-agentx-users-dark.png" width="760">
|
|
61
65
|
</picture>
|
|
62
66
|
</p>
|
|
63
67
|
|
|
64
|
-
| Users | Tokens per $: trn2 ÷ H200 | Tokens per $: trn2 ÷ H100 | P90 interactivity, tok/s per user: trn2 / H200 |
|
|
65
|
-
|
|
66
|
-
| 1 | **1.
|
|
67
|
-
| 4 | **1.
|
|
68
|
-
| 8 | **1.
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
trn2 delivers 0.
|
|
68
|
+
| Users | trn2 build | Tokens per $: trn2 ÷ H200 | Tokens per $: trn2 ÷ H100 | P90 interactivity, tok/s per user: trn2 / H200 |
|
|
69
|
+
|---|---|---|---|---|
|
|
70
|
+
| 1 | `latency-golden` | **1.73×** | **1.60×** | 66.3 / 272 |
|
|
71
|
+
| 4 | `latency-golden` | **1.89×** | **1.88×** | 51.3 / 235 |
|
|
72
|
+
| 8 | `latency-golden` | **1.63×** | **2.02×** | 27.6 / 168 |
|
|
73
|
+
| 16 | `balanced` | **1.09×** | **3.89×** | 14.2 / 87.8 |
|
|
74
|
+
| 24 | `throughput` | 0.87× | **5.17×** | 11.5 / 78.7 |
|
|
75
|
+
| 32 | `throughput` | 0.81× | **4.95×** | 10.7 / 50.1 |
|
|
76
|
+
|
|
77
|
+
**Where we're behind.** Each trn2 user is slower: P90 interactivity (1 / the P90 inter-token latency, as InferenceX
|
|
78
|
+
plots it; the wait for the first token is not in it) is 10.7-66.3 tok/s per user against H200's 50.1-272 (at 1-8
|
|
79
|
+
users both at synthetic golden acceptance). At 24 and 32 users H200 delivers more tokens per dollar (0.81-0.87×), and on
|
|
80
|
+
the 8K/1K fixed-length recipe, whose prompts share no prefix (its client's warmup sends the first timed prompt, so one
|
|
81
|
+
timed request per run can find it cached), trn2 delivers 0.89-1.00× H200's at 1-8 users and 0.52-0.82× at 16-64. Where a decode step's time goes is in
|
|
78
82
|
[docs/RESULTS.md](docs/RESULTS.md#where-a-decode-steps-time-goes).
|
|
79
83
|
|
|
80
84
|
<sub>InferenceX AgentX harness 1.0.12, canonical workload, one hour per point; ratios compare the same concurrency. The
|
|
81
|
-
1-8 user points use MTP at InferenceX's golden acceptance length (2.519; trn2's measured acceptance is 2.20)
|
|
82
|
-
AWS Capacity Blocks list, read 24 Nov 2026:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
1-8 user points use MTP at InferenceX's golden acceptance length (2.519; trn2's measured acceptance is 2.20): the
|
|
86
|
+
`latency-golden` build, whose output text is not the model's. Prices, AWS Capacity Blocks list, read 24 Nov 2026:
|
|
87
|
+
trn2.48xlarge $2.235 per Trainium2 chip-hour ($35.76 per instance-hour), p5.48xlarge $5.970 per H100-hour, p5e.48xlarge
|
|
88
|
+
$6.866 per H200-hour. Every trn2 point is a run of 0.2.0's code with the serve fixes, on 25 Nov 2026 (the 2.20
|
|
89
|
+
acceptance dates from 0.2.0), with
|
|
90
|
+
[benchmarks/](benchmarks/README.md) (the image from `docker/Dockerfile`, Neuron SDK 2.32, and a compile cache built from
|
|
91
|
+
source). GSM8K is 97.4-97.6% on the builds served with real acceptance (strict exact match, 5-shot, all 1,319 problems),
|
|
92
|
+
and each passed a needle test (on its answers; a host-tier restore is not observable on this server). GPU numbers are
|
|
93
|
+
InferenceX's public runs; we report no accuracy score for them and did not check them. Every table, source run and the method:
|
|
88
94
|
[docs/RESULTS.md](docs/RESULTS.md#against-h100-and-h200-inferencex-agentx-and-8k1k).</sub>
|
|
89
95
|
|
|
90
96
|
## Highlights
|
|
@@ -173,10 +179,15 @@ The full guide covers what each step needs, start-up checks, the three builds an
|
|
|
173
179
|
|---|---|
|
|
174
180
|
| **AWS Trainium2**, `trn2.48xlarge` (16 chips, 2 engines × TP 32, LNC 2) | ✅ Supported |
|
|
175
181
|
| **[GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)** (320B MoE, 18B active, FP8, 1M-token context) | ✅ Supported |
|
|
182
|
+
| **[Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)** (dense, Gated DeltaNet and gated attention, BF16) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
183
|
+
| **[GLM-5.3](https://huggingface.co/zai-org/GLM-5.3)** (MoE, latent attention with a sparse indexer, FP8) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
184
|
+
| **[DeepSeek-V4.1-Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash)** (MoE with MXFP4 experts, compressed sparse attention, Engram) | 🧪 Experimental: CPU-verified, not yet run on Trainium2 |
|
|
176
185
|
| More open models | 🔜 Coming soon. [Request a model](https://github.com/RunanywhereAI/trnrt/issues/new?template=30-model-request.yml) |
|
|
177
186
|
|
|
178
|
-
GLM-5.3-Flash is where TrnRT starts.
|
|
179
|
-
|
|
187
|
+
GLM-5.3-Flash is where TrnRT starts. An experimental model's code is in the tree and matches an upstream reference on
|
|
188
|
+
CPU on reduced configurations, but it has not run on Trainium2 here and no device number is claimed for it: [docs/MODELS.md](docs/MODELS.md)
|
|
189
|
+
says what each one has and what it still needs. [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#adding-a-model-family)
|
|
190
|
+
describes what a new model family needs.
|
|
180
191
|
|
|
181
192
|
## Benchmarks
|
|
182
193
|
|
|
@@ -194,14 +205,18 @@ at $35.76/h, the batch 12 cost is $0.167 per million tokens. Full tables, cold-p
|
|
|
194
205
|
methodology are in [docs/RESULTS.md](docs/RESULTS.md).
|
|
195
206
|
|
|
196
207
|
These numbers were measured with an earlier build of TrnRT, at release 0.1.0's batch presets, which this release's
|
|
197
|
-
builds replace.
|
|
208
|
+
builds replace. At release 0.1.0, this repository passed these checks against that build
|
|
198
209
|
([docs/KNOWN_ISSUES.md](docs/KNOWN_ISSUES.md#verification-status)):
|
|
199
210
|
|
|
200
|
-
- Graph equivalence: EQUAL on all 32 ranks, for all 157 graphs that build compiles in
|
|
211
|
+
- Graph equivalence: EQUAL on all 32 ranks, for all 157 graphs that build compiles in its default batch-12
|
|
201
212
|
configuration.
|
|
202
213
|
- Outputs: byte-identical to that build's on 384 of 384 requests.
|
|
203
|
-
- Serving: the two-engine serve in the [Quickstart](#quickstart) passed end to end on the device
|
|
204
|
-
|
|
214
|
+
- Serving: the two-engine serve in the [Quickstart](#quickstart) passed end to end on the device.
|
|
215
|
+
|
|
216
|
+
On 0.2.0's code with the serve fixes (24-25 Nov 2026), the builds read EQUAL against their reference builds, with
|
|
217
|
+
bitwise-equal outputs on the device, and the comparison with H100 and H200 above is a run of that code. 0.3.0 then
|
|
218
|
+
added the experimental model families, with a dispatch in two traced files: none of these checks, nor the two-engine
|
|
219
|
+
serve, has run on the device for 0.3.0 yet ([KNOWN_ISSUES.md](docs/KNOWN_ISSUES.md#verification-status)).
|
|
205
220
|
|
|
206
221
|
## How it works
|
|
207
222
|
|
|
@@ -224,11 +239,12 @@ trnrt/
|
|
|
224
239
|
├── __main__.py CLI: serve, engine, compile
|
|
225
240
|
├── serve/ OpenAI API, session-affine router, output parsers
|
|
226
241
|
├── engine/ scheduler, prefix caches, tensor parallelism
|
|
227
|
-
├── models/ GLM-5.3-Flash: KDA, DSA, mHC, MoE, FP8 loading
|
|
242
|
+
├── models/ GLM-5.3-Flash: KDA, DSA, mHC, MoE, FP8 loading; the experimental families
|
|
228
243
|
├── kernels/ NKI decode megakernels and prefill kernels
|
|
229
244
|
└── compile/ offline compile: shapes, capture, neuronx-cc, strip
|
|
230
245
|
docker/ the serving and compile image
|
|
231
246
|
tools/ graph-equivalence gate, device checks, doc checks
|
|
247
|
+
benchmarks/ the recipe for every published point: builds, clients, scorers, accuracy
|
|
232
248
|
tests/ CPU test suite (no NeuronCore needed)
|
|
233
249
|
docs/ guides, results, kernel notes
|
|
234
250
|
```
|
|
@@ -65,7 +65,10 @@ xfail_strict = true
|
|
|
65
65
|
[tool.ruff]
|
|
66
66
|
target-version = "py313"
|
|
67
67
|
line-length = 120
|
|
68
|
-
|
|
68
|
+
# tests/reference holds DeepSeek's released encoder and inference code, and benchmarks/accuracy/lm_eval_patch
|
|
69
|
+
# InferenceX's lm-eval hooks, each kept byte for byte (THIRD_PARTY_NOTICES.md): never reformatted or linted.
|
|
70
|
+
extend-exclude = ["build", "dist", "tests/reference/deepseek_v41_encoding.py", "tests/reference/deepseek_v41/model.py",
|
|
71
|
+
"tests/reference/deepseek_v41/engram.py", "benchmarks/accuracy/lm_eval_patch"]
|
|
69
72
|
|
|
70
73
|
[tool.ruff.format]
|
|
71
74
|
# Traced code is never reformatted: a moved line can change a kernel's compiled binary, and with it every compile-cache
|
|
@@ -131,6 +134,7 @@ ignore = [
|
|
|
131
134
|
"tests/**" = ["S101", "S106", "S311", "ARG", "T20"]
|
|
132
135
|
# Command-line programs print their output.
|
|
133
136
|
"tools/**" = ["T20"]
|
|
137
|
+
"benchmarks/**" = ["T20"]
|
|
134
138
|
"docker/**" = ["T20"]
|
|
135
139
|
"trnrt/__main__.py" = ["T20"]
|
|
136
140
|
"trnrt/compile/farm.py" = ["T20"]
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""The benchmark mode (synthetic acceptance) announces itself (trnrt/serve/benchmark_mode.py): the engine's and the router's
|
|
2
|
+
responses carry the x-trnrt-synthetic-acceptance header, /health carries a `benchmark_mode` block, and both warn in the
|
|
3
|
+
log. Without the mode nothing changes: no header, the same /health body."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
pytest.importorskip("fastapi")
|
|
12
|
+
pytest.importorskip("httpx") # fastapi.testclient
|
|
13
|
+
|
|
14
|
+
from trnrt.serve import benchmark_mode
|
|
15
|
+
from trnrt.serve.router import Router
|
|
16
|
+
|
|
17
|
+
AL = 2.518506
|
|
18
|
+
H = benchmark_mode.HEADER
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _engine_client(synth_al):
|
|
22
|
+
from fastapi.testclient import TestClient
|
|
23
|
+
|
|
24
|
+
from tests.test_serve_api import PLAIN, ScriptedEngine
|
|
25
|
+
from trnrt.serve import api
|
|
26
|
+
|
|
27
|
+
eng = ScriptedEngine(PLAIN)
|
|
28
|
+
if synth_al is not None:
|
|
29
|
+
eng.cfg.spec_synth_al = synth_al
|
|
30
|
+
return TestClient(api.build_app(eng, "glm")), eng
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _stop(eng):
|
|
34
|
+
from trnrt.serve import api
|
|
35
|
+
|
|
36
|
+
for lp in [lp for lp in api._LOOPS if lp.engine is eng]:
|
|
37
|
+
lp.stop()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_the_engine_announces_the_mode_on_every_response_and_in_health(caplog):
|
|
41
|
+
caplog.set_level(logging.WARNING)
|
|
42
|
+
client, eng = _engine_client(AL)
|
|
43
|
+
try:
|
|
44
|
+
with client:
|
|
45
|
+
assert "BENCHMARK MODE" in caplog.text and "2.51851" in caplog.text
|
|
46
|
+
h = client.get("/health")
|
|
47
|
+
assert h.status_code == 200 and h.headers[H] == "2.51851"
|
|
48
|
+
block = h.json()["benchmark_mode"]
|
|
49
|
+
assert block["synthetic_acceptance_length"] == AL and block["drafts_verified"] is False
|
|
50
|
+
assert client.get("/v1/models").headers[H] == "2.51851"
|
|
51
|
+
r = client.post("/v1/completions", json={"prompt": "Hello", "max_tokens": 3})
|
|
52
|
+
assert r.status_code == 200 and r.headers[H] == "2.51851"
|
|
53
|
+
with client.stream(
|
|
54
|
+
"POST", "/v1/completions", json={"prompt": "Hello", "max_tokens": 3, "stream": True}
|
|
55
|
+
) as s:
|
|
56
|
+
assert s.status_code == 200 and s.headers[H] == "2.51851"
|
|
57
|
+
lines = [ln for ln in s.iter_lines() if ln.startswith("data: ")]
|
|
58
|
+
assert lines[-1] == "data: [DONE]" # the stream itself is untouched
|
|
59
|
+
finally:
|
|
60
|
+
_stop(eng)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_a_failed_engine_still_announces_the_mode_in_its_503():
|
|
64
|
+
from trnrt.serve import api
|
|
65
|
+
|
|
66
|
+
client, eng = _engine_client(AL)
|
|
67
|
+
try:
|
|
68
|
+
with client:
|
|
69
|
+
loop = next(lp for lp in api._LOOPS if lp.engine is eng)
|
|
70
|
+
loop.health_error = lambda: "rank 3 died" # as EngineLoop._fail leaves it
|
|
71
|
+
h = client.get("/health")
|
|
72
|
+
assert h.status_code == 503 and h.json()["status"] == "failed" and h.json()["error"] == "rank 3 died"
|
|
73
|
+
assert h.json()["benchmark_mode"]["synthetic_acceptance_length"] == AL and h.headers[H] == "2.51851"
|
|
74
|
+
finally:
|
|
75
|
+
_stop(eng)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_without_the_mode_the_engine_adds_nothing():
|
|
79
|
+
client, eng = _engine_client(None)
|
|
80
|
+
try:
|
|
81
|
+
with client:
|
|
82
|
+
h = client.get("/health")
|
|
83
|
+
assert h.json() == {"status": "ok"} and H not in h.headers
|
|
84
|
+
r = client.post("/v1/completions", json={"prompt": "Hello", "max_tokens": 3})
|
|
85
|
+
assert r.status_code == 200 and H not in r.headers
|
|
86
|
+
finally:
|
|
87
|
+
_stop(eng)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _stats(al):
|
|
91
|
+
return {"gauges": {"kv_pages_used": 10, "kv_pages_total": 100, "spec": {"synth_al": al}}}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def test_the_router_takes_the_mode_from_its_workers_stats(caplog):
|
|
95
|
+
from fastapi.testclient import TestClient
|
|
96
|
+
|
|
97
|
+
from trnrt.serve.router import build_router_app
|
|
98
|
+
|
|
99
|
+
caplog.set_level(logging.WARNING)
|
|
100
|
+
router = Router(["http://127.0.0.1:9", "http://127.0.0.1:10"])
|
|
101
|
+
with TestClient(build_router_app(router, poll_s=0)) as c:
|
|
102
|
+
h = c.get("/health")
|
|
103
|
+
assert H not in h.headers and "benchmark_mode" not in h.json() # before any poll saw the mode
|
|
104
|
+
|
|
105
|
+
router.note_stats(0, _stats(None))
|
|
106
|
+
router.note_stats(1, {"gauges": {"kv_pages_used": 1, "kv_pages_total": 4}}) # no spec block at all
|
|
107
|
+
assert router.benchmark_lengths() == [] and router.kv_used == [0.1, 0.25]
|
|
108
|
+
assert H not in c.get("/health").headers
|
|
109
|
+
|
|
110
|
+
router.note_stats(1, _stats(AL))
|
|
111
|
+
router.note_stats(1, _stats(AL)) # warned once per change, not per poll
|
|
112
|
+
assert caplog.text.count("BENCHMARK MODE") == 1
|
|
113
|
+
assert "trnrt.router: worker http://127.0.0.1:10: " in caplog.text # the router's own log prefix
|
|
114
|
+
h = c.get("/health")
|
|
115
|
+
assert h.headers[H] == "2.51851" and h.json()["benchmark_mode"]["synthetic_acceptance_length"] == AL
|
|
116
|
+
assert c.get("/v1/models").headers[H] == "2.51851" # a 503 (no worker answers) says it too
|
|
117
|
+
|
|
118
|
+
router.note_stats(0, _stats(3.0)) # two lengths at once: both named
|
|
119
|
+
assert c.get("/health").headers[H] == "2.51851,3"
|
|
120
|
+
|
|
121
|
+
router.note_stats(0, _stats(None))
|
|
122
|
+
router.note_stats(1, _stats(None)) # restarted without the mode
|
|
123
|
+
assert H not in c.get("/health").headers
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def test_the_header_middleware_replaces_a_header_of_the_same_name():
|
|
127
|
+
from fastapi import FastAPI, Response
|
|
128
|
+
from fastapi.testclient import TestClient
|
|
129
|
+
|
|
130
|
+
app = FastAPI()
|
|
131
|
+
|
|
132
|
+
@app.get("/x")
|
|
133
|
+
async def x():
|
|
134
|
+
return Response("ok", headers={H: "stale"})
|
|
135
|
+
|
|
136
|
+
app.add_middleware(benchmark_mode.HeaderMiddleware, value=lambda: "2.5")
|
|
137
|
+
r = TestClient(app).get("/x")
|
|
138
|
+
assert r.headers.get_list(H) == ["2.5"]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def test_the_banner_says_what_the_text_is_not():
|
|
142
|
+
b = benchmark_mode.banner(AL)
|
|
143
|
+
assert "unverified" in b and "not the model's" in b and "never to judge output quality" in b
|