emmy-llm 0.1.1__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.
- emmy_llm-0.1.1/LICENSE +201 -0
- emmy_llm-0.1.1/PKG-INFO +378 -0
- emmy_llm-0.1.1/README.md +336 -0
- emmy_llm-0.1.1/emmy/__init__.py +48 -0
- emmy_llm-0.1.1/emmy/benchmark/__init__.py +50 -0
- emmy_llm-0.1.1/emmy/benchmark/bench_logging.py +146 -0
- emmy_llm-0.1.1/emmy/benchmark/command_workload.py +164 -0
- emmy_llm-0.1.1/emmy/benchmark/config.py +41 -0
- emmy_llm-0.1.1/emmy/benchmark/execution.py +421 -0
- emmy_llm-0.1.1/emmy/benchmark/fixed_hosts.py +98 -0
- emmy_llm-0.1.1/emmy/benchmark/results.py +229 -0
- emmy_llm-0.1.1/emmy/benchmark/system_info.py +73 -0
- emmy_llm-0.1.1/emmy/benchmark/tasks.py +69 -0
- emmy_llm-0.1.1/emmy/benchmark/workload.py +133 -0
- emmy_llm-0.1.1/emmy/commands/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/commands/bench/__init__.py +368 -0
- emmy_llm-0.1.1/emmy/commands/bench/committer.py +53 -0
- emmy_llm-0.1.1/emmy/commands/compare.py +187 -0
- emmy_llm-0.1.1/emmy/commands/compile.py +511 -0
- emmy_llm-0.1.1/emmy/commands/dataset_args.py +64 -0
- emmy_llm-0.1.1/emmy/commands/deploy/__init__.py +11 -0
- emmy_llm-0.1.1/emmy/commands/deploy/cloud.py +126 -0
- emmy_llm-0.1.1/emmy/commands/deploy/local.py +104 -0
- emmy_llm-0.1.1/emmy/commands/deploy/ssh.py +121 -0
- emmy_llm-0.1.1/emmy/commands/eval.py +850 -0
- emmy_llm-0.1.1/emmy/commands/generate.py +220 -0
- emmy_llm-0.1.1/emmy/commands/inspect_graph.py +66 -0
- emmy_llm-0.1.1/emmy/commands/pull.py +24 -0
- emmy_llm-0.1.1/emmy/commands/run.py +1729 -0
- emmy_llm-0.1.1/emmy/commands/serve.py +272 -0
- emmy_llm-0.1.1/emmy/commands/table.py +90 -0
- emmy_llm-0.1.1/emmy/commands/teardown.py +97 -0
- emmy_llm-0.1.1/emmy/commands/trace.py +317 -0
- emmy_llm-0.1.1/emmy/commands/tune.py +651 -0
- emmy_llm-0.1.1/emmy/commands/tune_progress.py +107 -0
- emmy_llm-0.1.1/emmy/commands/vm/__init__.py +31 -0
- emmy_llm-0.1.1/emmy/commands/vm/cloudrift.py +122 -0
- emmy_llm-0.1.1/emmy/commands/vm/gcp.py +104 -0
- emmy_llm-0.1.1/emmy/commands/vm/gpu.py +118 -0
- emmy_llm-0.1.1/emmy/commands/vm/types.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/__init__.py +28 -0
- emmy_llm-0.1.1/emmy/compiler/backend/__init__.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/backend/base.py +222 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/__init__.py +1 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/_bench_worker.py +179 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/_planner.py +103 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/_tma.py +187 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/backend.py +247 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/dtype.py +113 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/nvcc.py +177 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/program.py +1655 -0
- emmy_llm-0.1.1/emmy/compiler/backend/cuda/render_target.py +170 -0
- emmy_llm-0.1.1/emmy/compiler/backend/gpu_lock.py +61 -0
- emmy_llm-0.1.1/emmy/compiler/backend/loop/__init__.py +12 -0
- emmy_llm-0.1.1/emmy/compiler/backend/loop/backend.py +32 -0
- emmy_llm-0.1.1/emmy/compiler/backend/numpy/__init__.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/backend/numpy/backend.py +25 -0
- emmy_llm-0.1.1/emmy/compiler/backend/torch_ref.py +377 -0
- emmy_llm-0.1.1/emmy/compiler/context.py +262 -0
- emmy_llm-0.1.1/emmy/compiler/diagnostics/__init__.py +16 -0
- emmy_llm-0.1.1/emmy/compiler/diagnostics/bank_conflicts.py +593 -0
- emmy_llm-0.1.1/emmy/compiler/dim.py +250 -0
- emmy_llm-0.1.1/emmy/compiler/dtype.py +111 -0
- emmy_llm-0.1.1/emmy/compiler/graph.py +1003 -0
- emmy_llm-0.1.1/emmy/compiler/ir/__init__.py +36 -0
- emmy_llm-0.1.1/emmy/compiler/ir/algebra.py +126 -0
- emmy_llm-0.1.1/emmy/compiler/ir/axis.py +114 -0
- emmy_llm-0.1.1/emmy/compiler/ir/base.py +156 -0
- emmy_llm-0.1.1/emmy/compiler/ir/cuda/__init__.py +14 -0
- emmy_llm-0.1.1/emmy/compiler/ir/cuda/ir.py +88 -0
- emmy_llm-0.1.1/emmy/compiler/ir/elementwise.py +317 -0
- emmy_llm-0.1.1/emmy/compiler/ir/expr.py +1035 -0
- emmy_llm-0.1.1/emmy/compiler/ir/frontend/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/ir/frontend/ir.py +358 -0
- emmy_llm-0.1.1/emmy/compiler/ir/kernel/__init__.py +65 -0
- emmy_llm-0.1.1/emmy/compiler/ir/kernel/ir.py +1869 -0
- emmy_llm-0.1.1/emmy/compiler/ir/kernel/render.py +535 -0
- emmy_llm-0.1.1/emmy/compiler/ir/loop/__init__.py +58 -0
- emmy_llm-0.1.1/emmy/compiler/ir/loop/builder.py +61 -0
- emmy_llm-0.1.1/emmy/compiler/ir/loop/ir.py +476 -0
- emmy_llm-0.1.1/emmy/compiler/ir/loop/runner.py +149 -0
- emmy_llm-0.1.1/emmy/compiler/ir/loop/splicer.py +475 -0
- emmy_llm-0.1.1/emmy/compiler/ir/sigma.py +71 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/__init__.py +124 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/base.py +664 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/blocks.py +407 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/body.py +774 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/carrier_algebra.py +172 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/ir.py +141 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/leaves.py +1129 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/normalize.py +995 -0
- emmy_llm-0.1.1/emmy/compiler/ir/stmt/passes.py +325 -0
- emmy_llm-0.1.1/emmy/compiler/ir/tensor/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/ir/tensor/ir.py +296 -0
- emmy_llm-0.1.1/emmy/compiler/ir/tile/__init__.py +77 -0
- emmy_llm-0.1.1/emmy/compiler/ir/tile/ir.py +2305 -0
- emmy_llm-0.1.1/emmy/compiler/ir/tile/passes.py +246 -0
- emmy_llm-0.1.1/emmy/compiler/ir/twist.py +438 -0
- emmy_llm-0.1.1/emmy/compiler/loader/__init__.py +7 -0
- emmy_llm-0.1.1/emmy/compiler/loader/binder.py +98 -0
- emmy_llm-0.1.1/emmy/compiler/loader/safetensors.py +129 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/__init__.py +67 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/dump.py +524 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/fork.py +256 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/knob.py +876 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/010_sdpa.py +141 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/020_silu.py +36 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/030_pow.py +64 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/040_linear.py +43 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/050_fold_into_constant.py +36 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/060_fold_reshape_into_constant.py +16 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/070_matmul.py +31 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/080_rms_norm.py +60 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/085_layer_norm.py +77 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/090_mean.py +37 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/100_softmax.py +18 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/110_unsqueeze.py +24 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/120_transpose.py +45 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/130_reshape.py +91 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/140_slice.py +54 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/150_cat.py +79 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/160_gelu.py +54 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/170_gelu_tanh.py +80 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/_broadcast.py +127 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/_fold_constant.py +52 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/_helpers.py +157 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/decomposition/_matmul_helpers.py +80 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/optimization/010_compose_indexmaps.py +124 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/frontend/optimization/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/fusion/005_split_shared_indexmap.py +117 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/fusion/010_merge_loop_ops.py +183 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/fusion/020_dedup_loads.py +29 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/fusion/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/fusion/_helpers.py +105 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/lifting/010_lift_elementwise.py +96 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/lifting/020_lift_reduce.py +107 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/lifting/030_lift_indexmap.py +86 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/lifting/040_lift_gather.py +84 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/lifting/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/recognize/010_recognize_flash.py +255 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/recognize/020_recognize_online_softmax.py +116 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/recognize/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/recognize/_flash.py +594 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/stamp/010_stamp_loop_names.py +32 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/stamp/020_stamp_structural_features.py +52 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/stamp/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/loop/stamp/_stamp.py +135 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/__init__.py +0 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/_addr.py +26 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/_masking.py +94 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/_predicates.py +397 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/cuda/010_lower_kernelop.py +206 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/cuda/__init__.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/005_lower_atom_tile.py +849 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/009_clamp_masked_gmem_reads.py +117 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/010_split_register_axes.py +374 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/011_dedup_replicated.py +110 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/012_fuse_sibling_register_cells.py +202 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/015_pack_fk_window.py +183 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/020_place_inits.py +324 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/030_stamp_types.py +217 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/040_demote_to_write_dtype.py +253 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/050_vectorize_loads.py +291 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/070_pack_fp16_pairs.py +271 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/080_vectorize_stores.py +196 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/095_interleave_loads.py +234 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/100_materialize_tile.py +902 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/110_drop_redundant_syncs.py +108 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/__init__.py +6 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/_combine.py +232 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/_helpers.py +109 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/_stage_expand.py +564 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/kernel/_tma_groups.py +215 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/__init__.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/010_assemble.py +49 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/020_peel.py +148 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/030_mark_unroll.py +92 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/__init__.py +1 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/_assemble.py +748 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/_slab.py +488 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/assembly/_tower.py +234 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/010_build.py +82 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/020_tensorize.py +66 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/030_warp_geometry.py +33 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/040_warp_reg.py +36 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/050_warp_build.py +46 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/060_reduce_tile.py +73 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/070_coop_reduce.py +266 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/090_thread_tile.py +45 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/100_register_tile.py +50 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/110_seal_scalar_tier.py +39 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/120_stage.py +119 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/130_transport.py +228 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/150_cross_cta_finalize.py +274 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/__init__.py +5 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_atom.py +342 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_build.py +663 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_classify.py +111 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_cut.py +150 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_extract.py +717 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_families.py +390 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_iterdag.py +467 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_knob_legacy.py +148 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_knobs.py +150 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_moves.py +561 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_partition.py +242 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_stage.py +142 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/enumeration/_validate.py +161 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/split/010_split_demoted.py +171 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/passes/lowering/tile/split/__init__.py +8 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/pipeline.py +1384 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/rule_diff.py +200 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/__init__.py +45 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/analytic.py +193 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/candidate.py +531 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/data/__init__.py +12 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/data/dataset.py +123 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/data/sample.py +176 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/data/shape.py +88 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/db.py +752 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/golden.py +300 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/goldens/rtx4090_sm89.yaml +245 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/goldens/rtx5090_sm120.yaml +392 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/goldens/rtxpro6000_sm120.yaml +254 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/keys.py +125 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/policy/__init__.py +16 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/policy/base.py +68 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/policy/greedy.py +331 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/policy/mcts.py +435 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/__init__.py +18 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/analytic.py +222 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/base.py +293 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/catboost.py +202 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/diagnostics.py +369 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/prior/fallback.py +128 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/slice.py +106 -0
- emmy_llm-0.1.1/emmy/compiler/pipeline/search/two_level.py +517 -0
- emmy_llm-0.1.1/emmy/compiler/provenance.py +252 -0
- emmy_llm-0.1.1/emmy/compiler/render_target.py +80 -0
- emmy_llm-0.1.1/emmy/compiler/structural.py +57 -0
- emmy_llm-0.1.1/emmy/compiler/target.py +134 -0
- emmy_llm-0.1.1/emmy/compiler/tensor.py +50 -0
- emmy_llm-0.1.1/emmy/compiler/trace/__init__.py +13 -0
- emmy_llm-0.1.1/emmy/compiler/trace/dynamic.py +88 -0
- emmy_llm-0.1.1/emmy/compiler/trace/huggingface.py +316 -0
- emmy_llm-0.1.1/emmy/compiler/trace/torch.py +815 -0
- emmy_llm-0.1.1/emmy/compiler/tuning.py +481 -0
- emmy_llm-0.1.1/emmy/config.py +285 -0
- emmy_llm-0.1.1/emmy/deploy/__init__.py +37 -0
- emmy_llm-0.1.1/emmy/deploy/compose.py +166 -0
- emmy_llm-0.1.1/emmy/deploy/local.py +74 -0
- emmy_llm-0.1.1/emmy/deploy/log_phases.py +105 -0
- emmy_llm-0.1.1/emmy/deploy/orchestrate.py +299 -0
- emmy_llm-0.1.1/emmy/deploy/params.py +20 -0
- emmy_llm-0.1.1/emmy/deploy/scale_out.py +61 -0
- emmy_llm-0.1.1/emmy/detect.py +87 -0
- emmy_llm-0.1.1/emmy/emmy.py +60 -0
- emmy_llm-0.1.1/emmy/gpu.py +329 -0
- emmy_llm-0.1.1/emmy/hardware.py +145 -0
- emmy_llm-0.1.1/emmy/logging_setup.py +21 -0
- emmy_llm-0.1.1/emmy/planner/__init__.py +158 -0
- emmy_llm-0.1.1/emmy/planner/group_by_model_and_gpu.py +63 -0
- emmy_llm-0.1.1/emmy/planner/variant.py +102 -0
- emmy_llm-0.1.1/emmy/provisioning/__init__.py +43 -0
- emmy_llm-0.1.1/emmy/provisioning/candidates.py +95 -0
- emmy_llm-0.1.1/emmy/provisioning/cloud.py +376 -0
- emmy_llm-0.1.1/emmy/provisioning/cloudrift.py +485 -0
- emmy_llm-0.1.1/emmy/provisioning/errors.py +35 -0
- emmy_llm-0.1.1/emmy/provisioning/gcp.py +305 -0
- emmy_llm-0.1.1/emmy/provisioning/host.py +143 -0
- emmy_llm-0.1.1/emmy/provisioning/remote.py +348 -0
- emmy_llm-0.1.1/emmy/provisioning/shell.py +41 -0
- emmy_llm-0.1.1/emmy/provisioning/ssh.py +39 -0
- emmy_llm-0.1.1/emmy/provisioning/ssh_target.py +28 -0
- emmy_llm-0.1.1/emmy/provisioning/ssh_transport.py +202 -0
- emmy_llm-0.1.1/emmy/provisioning/staging.py +108 -0
- emmy_llm-0.1.1/emmy/provisioning/types.py +19 -0
- emmy_llm-0.1.1/emmy/recipe/__init__.py +56 -0
- emmy_llm-0.1.1/emmy/recipe/engines.py +74 -0
- emmy_llm-0.1.1/emmy/recipe/matrix.py +150 -0
- emmy_llm-0.1.1/emmy/recipe/recipe.py +183 -0
- emmy_llm-0.1.1/emmy/recipe/types.py +262 -0
- emmy_llm-0.1.1/emmy/redact.py +103 -0
- emmy_llm-0.1.1/emmy/serving/__init__.py +16 -0
- emmy_llm-0.1.1/emmy/serving/gen_runner.py +303 -0
- emmy_llm-0.1.1/emmy/serving/packed.py +33 -0
- emmy_llm-0.1.1/emmy/serving/runner.py +271 -0
- emmy_llm-0.1.1/emmy/serving/sampling.py +87 -0
- emmy_llm-0.1.1/emmy/serving/vllm_model.py +103 -0
- emmy_llm-0.1.1/emmy/serving/vllm_model_gen.py +177 -0
- emmy_llm-0.1.1/emmy/storage.py +63 -0
- emmy_llm-0.1.1/emmy/timing.py +141 -0
- emmy_llm-0.1.1/emmy/visualize/__init__.py +24 -0
- emmy_llm-0.1.1/emmy/visualize/bar_chart.py +200 -0
- emmy_llm-0.1.1/emmy/visualize/image.py +96 -0
- emmy_llm-0.1.1/emmy/visualize/page.py +79 -0
- emmy_llm-0.1.1/emmy/visualize/theme.py +127 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/PKG-INFO +378 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/SOURCES.txt +316 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/dependency_links.txt +1 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/entry_points.txt +5 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/requires.txt +40 -0
- emmy_llm-0.1.1/emmy_llm.egg-info/top_level.txt +1 -0
- emmy_llm-0.1.1/pyproject.toml +64 -0
- emmy_llm-0.1.1/setup.cfg +4 -0
- emmy_llm-0.1.1/tests/test_detect.py +73 -0
- emmy_llm-0.1.1/tests/test_dim_arithmetic.py +115 -0
- emmy_llm-0.1.1/tests/test_gpu.py +109 -0
- emmy_llm-0.1.1/tests/test_hardware.py +64 -0
- emmy_llm-0.1.1/tests/test_new_models.py +120 -0
- emmy_llm-0.1.1/tests/test_redact.py +213 -0
- emmy_llm-0.1.1/tests/test_storage.py +42 -0
- emmy_llm-0.1.1/tests/test_timing.py +105 -0
- emmy_llm-0.1.1/tests/test_visualize.py +122 -0
emmy_llm-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
emmy_llm-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: emmy-llm
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Deploy and benchmark LLM inference on GPU servers using vLLM
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: huggingface_hub[cli,hf_transfer]
|
|
9
|
+
Requires-Dist: httpx
|
|
10
|
+
Requires-Dist: numpy
|
|
11
|
+
Requires-Dist: pyyaml
|
|
12
|
+
Requires-Dist: catboost
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Requires-Dist: pytest; extra == "test"
|
|
15
|
+
Requires-Dist: pytest-asyncio; extra == "test"
|
|
16
|
+
Requires-Dist: pytest-xdist; extra == "test"
|
|
17
|
+
Requires-Dist: ruff; extra == "test"
|
|
18
|
+
Provides-Extra: compile
|
|
19
|
+
Requires-Dist: torch; extra == "compile"
|
|
20
|
+
Requires-Dist: transformers>=5.10; extra == "compile"
|
|
21
|
+
Requires-Dist: cppyy==3.5.0; extra == "compile"
|
|
22
|
+
Requires-Dist: safetensors; extra == "compile"
|
|
23
|
+
Provides-Extra: serving
|
|
24
|
+
Requires-Dist: vllm<0.23,>=0.22.1; extra == "serving"
|
|
25
|
+
Requires-Dist: fastapi[standard]<0.137; extra == "serving"
|
|
26
|
+
Provides-Extra: visualize
|
|
27
|
+
Requires-Dist: playwright>=1.40; extra == "visualize"
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff; extra == "dev"
|
|
33
|
+
Requires-Dist: matplotlib; extra == "dev"
|
|
34
|
+
Requires-Dist: graphviz; extra == "dev"
|
|
35
|
+
Requires-Dist: torch; extra == "dev"
|
|
36
|
+
Requires-Dist: transformers>=5.10; extra == "dev"
|
|
37
|
+
Requires-Dist: cupy-cuda12x; sys_platform == "linux" and extra == "dev"
|
|
38
|
+
Requires-Dist: cppyy==3.5.0; extra == "dev"
|
|
39
|
+
Requires-Dist: safetensors; extra == "dev"
|
|
40
|
+
Requires-Dist: playwright>=1.40; extra == "dev"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<a href="https://pypi.org/project/emmy-llm/"><img src="https://img.shields.io/pypi/v/emmy-llm" alt="PyPI"></a>
|
|
45
|
+
<a href="https://github.com/cloudrift-ai/emmy/actions/workflows/tests.yml"><img src="https://github.com/cloudrift-ai/emmy/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
|
|
46
|
+
<a href="https://discord.gg/cloudrift"><img src="https://img.shields.io/discord/1150997934113030174?label=Discord" alt="Discord"></a>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
**Compile → Benchmark → Deploy** any LLM on any GPU. vLLM, SGLang, or create your own specialized deployment using a hackable compiler.
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/cloudrift-ai/emmy.git
|
|
55
|
+
cd emmy && make setup
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Compile
|
|
59
|
+
|
|
60
|
+
A hackable PyTorch → Graph IR → CUDA compiler. Trace any `nn.Module`, fuse it into one kernel, run it, and inspect the emitted CUDA. See the blog post: [*A Principled ML Compiler Stack in 5,000 Lines of Python*](https://www.cloudrift.ai/blog/building-gpu-compiler-from-scratch-1).
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Compile a single layer
|
|
64
|
+
emmy compile -c "nn.RMSNorm(2048)(torch.randn(1,32,2048))"
|
|
65
|
+
# Benchmark, profile and optimize kernels locally
|
|
66
|
+
emmy run --bench --profile -c "torch.nn.Softmax(dim=-1)(torch.randn(1, 28, 2048, 2048))"
|
|
67
|
+
# Compile full model from HuggingFace (will download weights)
|
|
68
|
+
emmy compile Qwen/Qwen3-Embedding-0.6B
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Layer-norm-style reduction (two reductions, broadcast subtract, elementwise chain) fused into two kernels:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
emmy compile -c "
|
|
75
|
+
class LN(torch.nn.Module):
|
|
76
|
+
def forward(self, x):
|
|
77
|
+
m = x.mean(-1, keepdim=True)
|
|
78
|
+
v = ((x - m) ** 2).mean(-1, keepdim=True)
|
|
79
|
+
return (x - m) * torch.rsqrt(v + 1e-6)
|
|
80
|
+
LN()(torch.randn(64, 2048))"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Principled compilation stack with six IR stages, each printable on demand via `--ir <stage>`:
|
|
84
|
+
|
|
85
|
+
1. **Torch IR** — captures the FX graph as a 1:1 mirror of PyTorch's op set (`rmsnorm`, `linear`, `softmax`, ...)
|
|
86
|
+
2. **Tensor IR** — decomposes every Torch op into three primitives: `Elementwise`, `Reduction`, and `IndexMap`
|
|
87
|
+
3. **Loop IR** — lifts each primitive to a `LoopOp` and fuses
|
|
88
|
+
4. **Tile IR** — schedules kernels onto GPU
|
|
89
|
+
5. **Kernel IR** — materializes the schedule into framework-agnostic hardware primitives
|
|
90
|
+
6. **CUDA** — optimized CUDA code ready for `nvcc`
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
**Readable Schedule**: `emmy compile -c "nn.RMSNorm(2048)(torch.randn(1,32,2048))" --ir tile`
|
|
94
|
+
```
|
|
95
|
+
kernel k_rms_norm_reduce inputs: rms_norm_mean_count, rms_norm_eps, x, p_weight outputs: rms_norm
|
|
96
|
+
in0 = load rms_norm_mean_count[0]
|
|
97
|
+
in1 = load rms_norm_eps[0]
|
|
98
|
+
Tile(axes=(a0:256=THREAD, a1:32=BLOCK)):
|
|
99
|
+
x_smem = Stage(x, origin=(0, a1, 0), slab=(a2:2048@2)) async
|
|
100
|
+
p_weight_smem = Stage(p_weight, origin=(0), slab=(a3:2048@0)) async
|
|
101
|
+
StridedLoop(a2 = a0; < 2048; += 256): # reduce
|
|
102
|
+
in2 = load x_smem[a2]
|
|
103
|
+
v0 = multiply(in2, in2)
|
|
104
|
+
acc0 <- add(acc0, v0)
|
|
105
|
+
v1 = divide(acc0, in0)
|
|
106
|
+
v2 = add(v1, in1)
|
|
107
|
+
v3 = rsqrt(v2)
|
|
108
|
+
StridedLoop(a3 = a0; < 2048; += 256): # free
|
|
109
|
+
in3 = load x_smem[a3]
|
|
110
|
+
in4 = load p_weight_smem[a3]
|
|
111
|
+
v4 = multiply(in3, v3)
|
|
112
|
+
v5 = multiply(v4, in4)
|
|
113
|
+
rms_norm[0, a1, a3] = v5
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Optimized CUDA kernel**: `emmy compile -c "nn.RMSNorm(2048)(torch.randn(1,32,2048))" --ir cuda`
|
|
117
|
+
|
|
118
|
+
```c
|
|
119
|
+
extern "C" __global__
|
|
120
|
+
__launch_bounds__(256) void k_rms_norm_reduce(const float* x, const float* p_weight, float* rms_norm) {
|
|
121
|
+
float in0 = 2048.0f;
|
|
122
|
+
float in1 = 1e-06f;
|
|
123
|
+
{
|
|
124
|
+
int a1 = blockIdx.x;
|
|
125
|
+
int a0 = threadIdx.x;
|
|
126
|
+
float acc0 = 0.0f;
|
|
127
|
+
__syncthreads();
|
|
128
|
+
__shared__ float x_smem[2048];
|
|
129
|
+
for (int x_smem_flat = a0; x_smem_flat < 2048; x_smem_flat += 256) {
|
|
130
|
+
{
|
|
131
|
+
unsigned int _smem_addr = __cvta_generic_to_shared(&x_smem[x_smem_flat]);
|
|
132
|
+
asm volatile("cp.async.ca.shared.global [%0], [%1], 4;\n"
|
|
133
|
+
:: "r"(_smem_addr), "l"(&x[a1 * 2048 + x_smem_flat])
|
|
134
|
+
: "memory");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
asm volatile("cp.async.commit_group;\n" ::: "memory");
|
|
138
|
+
asm volatile("cp.async.wait_group 0;\n" ::: "memory");
|
|
139
|
+
__syncthreads();
|
|
140
|
+
__shared__ float p_weight_smem[2048];
|
|
141
|
+
for (int p_weight_smem_flat = a0; p_weight_smem_flat < 2048; p_weight_smem_flat += 256) {
|
|
142
|
+
{
|
|
143
|
+
unsigned int _smem_addr = __cvta_generic_to_shared(&p_weight_smem[p_weight_smem_flat]);
|
|
144
|
+
asm volatile("cp.async.ca.shared.global [%0], [%1], 4;\n"
|
|
145
|
+
:: "r"(_smem_addr), "l"(&p_weight[p_weight_smem_flat])
|
|
146
|
+
: "memory");
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
asm volatile("cp.async.commit_group;\n" ::: "memory");
|
|
150
|
+
asm volatile("cp.async.wait_group 0;\n" ::: "memory");
|
|
151
|
+
__syncthreads();
|
|
152
|
+
for (int a2 = a0; a2 < 2048; a2 += 256) {
|
|
153
|
+
float in2 = x_smem[a2];
|
|
154
|
+
float v0 = in2 * in2;
|
|
155
|
+
acc0 += v0;
|
|
156
|
+
}
|
|
157
|
+
__shared__ float acc0_smem[256];
|
|
158
|
+
acc0_smem[a0] = acc0;
|
|
159
|
+
__syncthreads();
|
|
160
|
+
for (int s = 128; s > 0; s >>= 1) {
|
|
161
|
+
if (a0 < s) {
|
|
162
|
+
acc0_smem[a0] = acc0_smem[a0] + acc0_smem[a0 + s];
|
|
163
|
+
}
|
|
164
|
+
__syncthreads();
|
|
165
|
+
}
|
|
166
|
+
__syncthreads();
|
|
167
|
+
float acc0_b = acc0_smem[0];
|
|
168
|
+
float v1 = acc0_b / in0;
|
|
169
|
+
float v2 = v1 + in1;
|
|
170
|
+
float v3 = rsqrtf(v2);
|
|
171
|
+
for (int a3 = a0; a3 < 2048; a3 += 256) {
|
|
172
|
+
float in3 = x_smem[a3];
|
|
173
|
+
float in4 = p_weight_smem[a3];
|
|
174
|
+
float v4 = in3 * v3;
|
|
175
|
+
float v5 = v4 * in4;
|
|
176
|
+
rms_norm[a1 * 2048 + a3] = v5;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Benchmark
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
emmy bench recipes/* # All recipes
|
|
186
|
+
emmy bench experiments/.../optimal_mcr_rtx5090 # An experiment
|
|
187
|
+
emmy bench recipes/* --filter "deploy.gpu=*5090*" # Subset
|
|
188
|
+
emmy bench recipes/* --gpu-concurrency 4 # Parallel VMs per GPU
|
|
189
|
+
emmy bench recipes/* --local # On this machine
|
|
190
|
+
emmy bench recipes/* --ssh user@host1 --ssh user@host2 # Pre-allocated hosts
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
External contributors: open a PR with an experiment under `experiments/{model}/{name}/`, then a maintainer triggers a cloud run by commenting `/run-experiment` on the PR.
|
|
194
|
+
|
|
195
|
+
## Deploy
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Remote server via SSH
|
|
199
|
+
emmy deploy ssh --recipe recipes/GLM-4.6-FP8 --ssh user@host
|
|
200
|
+
|
|
201
|
+
# Local Docker Compose
|
|
202
|
+
emmy deploy local --recipe recipes/Qwen3-Coder-30B-A3B-Instruct-AWQ
|
|
203
|
+
|
|
204
|
+
# Cloud (auto-provisions a VM)
|
|
205
|
+
emmy deploy cloud --recipe recipes/GLM-4.6-FP8 --gpu "NVIDIA H200 141GB" --gpu-count 8
|
|
206
|
+
|
|
207
|
+
# Teardown / preview
|
|
208
|
+
emmy deploy ssh --recipe recipes/GLM-4.6-FP8 --ssh user@host --teardown
|
|
209
|
+
emmy deploy ssh --recipe recipes/GLM-4.6-FP8 --ssh user@host --dry-run
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Serve (compiled embeddings via vLLM)
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# vLLM's OpenAI shell (/v1/embeddings, tokenizer, scheduler, pooler) over emmy-compiled kernels
|
|
216
|
+
pip install -e ".[compile,serving]"
|
|
217
|
+
emmy serve Qwen/Qwen3-Embedding-0.6B # extra flags pass through to vllm serve
|
|
218
|
+
|
|
219
|
+
curl localhost:8000/v1/embeddings -H 'Content-Type: application/json' \
|
|
220
|
+
-d '{"model":"Qwen/Qwen3-Embedding-0.6B","input":"Hello"}'
|
|
221
|
+
|
|
222
|
+
# One-shot benchmark (vllm bench serve against the started server), and the raw-vLLM baseline
|
|
223
|
+
emmy serve Qwen/Qwen3-Embedding-0.6B --bench --random-input-len 32
|
|
224
|
+
emmy serve Qwen/Qwen3-Embedding-0.6B --bench --random-input-len 32 --stock
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
See [`emmy/serving/ARCHITECTURE.md`](emmy/serving/ARCHITECTURE.md); embedding recipes
|
|
228
|
+
(`recipes/Qwen3-Embedding-*`) A/B this against stock vLLM via `emmy bench`.
|
|
229
|
+
|
|
230
|
+
## Generate (chat) — experimental
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Standalone generation oracle (no vLLM) — re-runs the whole prefix each step, O(S²); the
|
|
234
|
+
# token-for-token reference (matches HF eager greedy, e.g. on TinyLlama-1.1B-Chat).
|
|
235
|
+
emmy generate TinyLlama/TinyLlama-1.1B-Chat-v1.0 --prompt "The capital of France is" --max-new-tokens 10
|
|
236
|
+
|
|
237
|
+
# Serve a chat model through emmy-compiled per-layer kernels (vLLM owns the OpenAI API /
|
|
238
|
+
# sampler / scheduler / paged KV-cache / lm_head; emmy owns embed + the trunk).
|
|
239
|
+
emmy serve TinyLlama/TinyLlama-1.1B-Chat-v1.0 --generate
|
|
240
|
+
curl localhost:8000/v1/chat/completions -H 'Content-Type: application/json' \
|
|
241
|
+
-d '{"model":"TinyLlama/TinyLlama-1.1B-Chat-v1.0","messages":[{"role":"user","content":"Hi"}]}'
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Status:** correctness complete for decoder-only **Llama / Qwen3** (full-causal, fp16, TP=1). Perf is **not yet
|
|
245
|
+
hardened** — host-sync interleave at the per-layer seam, and `serve` compiles 2× n_layers programs (startup- and
|
|
246
|
+
memory-heavy → small models for now). Design + phase status:
|
|
247
|
+
[`plans/generative-inference-support.md`](plans/generative-inference-support.md).
|
|
248
|
+
|
|
249
|
+
## Recipe
|
|
250
|
+
|
|
251
|
+
```yaml
|
|
252
|
+
model:
|
|
253
|
+
huggingface: "org/model-name"
|
|
254
|
+
|
|
255
|
+
engine:
|
|
256
|
+
llm:
|
|
257
|
+
tensor_parallel_size: 8
|
|
258
|
+
gpu_memory_utilization: 0.9
|
|
259
|
+
context_length: 16384
|
|
260
|
+
max_concurrent_requests: 512
|
|
261
|
+
vllm:
|
|
262
|
+
image: "vllm/vllm-openai:v0.17.0"
|
|
263
|
+
extra_args: "--kv-cache-dtype fp8"
|
|
264
|
+
|
|
265
|
+
benchmark:
|
|
266
|
+
max_concurrency: 128
|
|
267
|
+
num_prompts: 256
|
|
268
|
+
random_input_len: 8000
|
|
269
|
+
random_output_len: 8000
|
|
270
|
+
|
|
271
|
+
# Cross-product: 3 GPUs × 2 concurrency configs = 6 variants
|
|
272
|
+
matrices:
|
|
273
|
+
cross:
|
|
274
|
+
deploy.gpu_count: 1
|
|
275
|
+
deploy.gpu:
|
|
276
|
+
- "NVIDIA GeForce RTX 5090"
|
|
277
|
+
- "NVIDIA H100 80GB"
|
|
278
|
+
- "NVIDIA H200 141GB"
|
|
279
|
+
zip:
|
|
280
|
+
engine.llm.max_concurrent_requests: [128, 512]
|
|
281
|
+
benchmark.max_concurrency: [128, 512]
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Generic workload (run any tool on the VM, pull back result files):
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
command:
|
|
288
|
+
stage: ["scripts"]
|
|
289
|
+
run: |
|
|
290
|
+
nvidia-smi --query-gpu=name,memory.used --format=csv > $task_dir/result.csv
|
|
291
|
+
result_files: ["result.csv"]
|
|
292
|
+
timeout: 60
|
|
293
|
+
|
|
294
|
+
matrices:
|
|
295
|
+
deploy.gpu: "NVIDIA GeForce RTX 5090"
|
|
296
|
+
deploy.gpu_count: 1
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Virtual Machine Management
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# GCP
|
|
303
|
+
emmy vm create gcp --instance my-vm --zone us-central1-a --machine-type a2-highgpu-1g
|
|
304
|
+
emmy vm delete gcp --instance my-vm --zone us-central1-a
|
|
305
|
+
|
|
306
|
+
# CloudRift
|
|
307
|
+
emmy vm create cloudrift --instance-type rtx4090.1 --ssh-key ~/.ssh/id_ed25519.pub
|
|
308
|
+
emmy vm delete cloudrift --instance-id <id>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Development
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
make test # run pytest
|
|
315
|
+
make lint # ruff check + format check
|
|
316
|
+
make format # auto-fix
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Project Structure
|
|
320
|
+
|
|
321
|
+
- [emmy/](emmy/) — Python package
|
|
322
|
+
- [emmy.py](emmy/emmy.py) — CLI entrypoint
|
|
323
|
+
- [logging_setup.py](emmy/logging_setup.py) — CLI logging configuration
|
|
324
|
+
- [hardware.py](emmy/hardware.py) — GPU specs and instance type mapping
|
|
325
|
+
- [detect.py](emmy/detect.py) — GPU detection via PCI sysfs (local and remote)
|
|
326
|
+
- [redact.py](emmy/redact.py) — Secret redaction for logs and dumps
|
|
327
|
+
- [commands/](emmy/commands/) — CLI layer (thin argparse handlers, see [ARCHITECTURE.md](emmy/commands/ARCHITECTURE.md))
|
|
328
|
+
- [deploy/](emmy/commands/deploy/) — `deploy local`, `deploy ssh`, `deploy cloud` commands
|
|
329
|
+
- [bench/](emmy/commands/bench/) — `bench` command
|
|
330
|
+
- [vm/](emmy/commands/vm/) — `vm create/delete` commands (GCP, CloudRift)
|
|
331
|
+
- [teardown.py](emmy/commands/teardown.py) — `teardown` command
|
|
332
|
+
- [pull.py](emmy/commands/pull.py) — `pull` command (download HF model)
|
|
333
|
+
- [trace.py](emmy/commands/trace.py) — `trace` command (PyTorch → Graph IR)
|
|
334
|
+
- [compile.py](emmy/commands/compile.py) — `compile` command (decomposition → optimization → fusion → kernel/CUDA lowering)
|
|
335
|
+
- [run.py](emmy/commands/run.py) — `run` command (compile + execute on CUDA backend, optional benchmarks)
|
|
336
|
+
- [inspect_graph.py](emmy/commands/inspect_graph.py) — `inspect` command (graph summary)
|
|
337
|
+
- [compiler/](emmy/compiler/) — PyTorch → Graph IR → CUDA compiler (see [ARCHITECTURE.md](emmy/compiler/ARCHITECTURE.md))
|
|
338
|
+
- [graph.py](emmy/compiler/graph.py) — `Graph`, `Node`, `Tensor`, `Hints` container
|
|
339
|
+
- [ir/](emmy/compiler/ir/) — per-dialect op definitions (torch / tensor / loop / kernel / cuda) (see [ARCHITECTURE.md](emmy/compiler/ir/ARCHITECTURE.md))
|
|
340
|
+
- [trace/](emmy/compiler/trace/) — PyTorch/HuggingFace → Graph IR capture (see [ARCHITECTURE.md](emmy/compiler/trace/ARCHITECTURE.md))
|
|
341
|
+
- [pipeline/](emmy/compiler/pipeline/) — rewrite engine + passes + dump hooks (see [ARCHITECTURE.md](emmy/compiler/pipeline/ARCHITECTURE.md))
|
|
342
|
+
- [rules/](emmy/compiler/rules/) — rewrite rules (decomposition, optimization, fusion, lowering)
|
|
343
|
+
- [program/](emmy/compiler/program/) — kernel program assembly (LoopOp → KernelOp → CudaOp)
|
|
344
|
+
- [cuda/](emmy/compiler/cuda/) — CUDA source rendering and runtime helpers
|
|
345
|
+
- [backend/](emmy/compiler/backend/) — numpy / loop / CUDA execution (see [ARCHITECTURE.md](emmy/compiler/backend/ARCHITECTURE.md))
|
|
346
|
+
- [cuda/](emmy/compiler/backend/cuda/) — CUDA backend internals (see [ARCHITECTURE.md](emmy/compiler/backend/cuda/ARCHITECTURE.md))
|
|
347
|
+
- [tuning.py](emmy/compiler/tuning.py) — autotuning utilities
|
|
348
|
+
- [recipe/](emmy/recipe/) — Recipe loading, dataclass types, engine flag mapping (see [ARCHITECTURE.md](emmy/recipe/ARCHITECTURE.md))
|
|
349
|
+
- [serving/](emmy/serving/) — vLLM out-of-tree embedding plugin (see [ARCHITECTURE.md](emmy/serving/ARCHITECTURE.md))
|
|
350
|
+
- [deploy/](emmy/deploy/) — Compose generation, deploy orchestration
|
|
351
|
+
- [provisioning/](emmy/provisioning/) — Cloud provisioning, SSH transport, VM lifecycle
|
|
352
|
+
- [benchmark/](emmy/benchmark/) — Benchmark tracking, config, task enumeration, execution
|
|
353
|
+
- [planner/](emmy/planner/) — Groups benchmark tasks into execution groups for VM allocation
|
|
354
|
+
- [recipes/](recipes/) — Model deploy recipes (YAML configs per model)
|
|
355
|
+
- [docker/](docker/) — Custom image builds ([vllm-emmy](docker/vllm-emmy/) — vLLM + the emmy plugin)
|
|
356
|
+
- [experiments/](experiments/) — Experiment parameter sweeps (self-contained recipe + results)
|
|
357
|
+
- [kernels/](kernels/) — Standalone CUDA kernel sources
|
|
358
|
+
- [docs/](docs/) — Technical notes and engine-specific guides
|
|
359
|
+
- [sglang-awq-moe.md](docs/sglang-awq-moe.md) — SGLang quantization for AWQ MoE models
|
|
360
|
+
- [tests/](tests/) — pytest tests (see [ARCHITECTURE.md](tests/ARCHITECTURE.md))
|
|
361
|
+
- [compiler/passes/](tests/compiler/passes/) — compiler pass tests (see [ARCHITECTURE.md](tests/compiler/passes/ARCHITECTURE.md))
|
|
362
|
+
- [scripts/](scripts/) — Analysis and visualization scripts
|
|
363
|
+
- [utils/](utils/) — Standalone utility scripts
|
|
364
|
+
- [config.yaml](config.yaml) — Benchmark configuration
|
|
365
|
+
- [Makefile](Makefile) — Build automation
|
|
366
|
+
- [pyproject.toml](pyproject.toml) — Package metadata and tool config
|
|
367
|
+
|
|
368
|
+
## Contributing
|
|
369
|
+
|
|
370
|
+
1. Branch from `main` (e.g. `feature/my-change`).
|
|
371
|
+
2. Follow [STYLE.md](STYLE.md) and per-directory `ARCHITECTURE.md` files.
|
|
372
|
+
3. Add tests in `tests/` (see [tests/ARCHITECTURE.md](tests/ARCHITECTURE.md)).
|
|
373
|
+
4. `make test && make lint` (use `make format` to auto-fix).
|
|
374
|
+
5. Open a PR against `main`.
|
|
375
|
+
|
|
376
|
+
## License
|
|
377
|
+
|
|
378
|
+
Licensed under the [Apache License 2.0](LICENSE).
|