[ignore-for-now][llm_trainer] Add experiment for LLM-driven model optimization#3006
Closed
bobrenjc93 wants to merge 9 commits intogh/bobrenjc93/43/basefrom
Closed
[ignore-for-now][llm_trainer] Add experiment for LLM-driven model optimization#3006bobrenjc93 wants to merge 9 commits intogh/bobrenjc93/43/basefrom
bobrenjc93 wants to merge 9 commits intogh/bobrenjc93/43/basefrom
Conversation
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: b011200 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: e5feea0 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: b817ccb Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: 90f76c6 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: 3a2e782 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: c3775b1 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 17, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: e8114a9 Pull-Request: #3006
bobrenjc93
added a commit
that referenced
this pull request
Apr 19, 2026
…imization Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. ghstack-source-id: 2c324d2 Pull-Request: #3006
This was referenced Apr 21, 2026
…n model optimization" Adds the llm_trainer experiment which traces a model's full forward+backward training step into a flat sequence of ATen ops, then provides benchmarking infra for an LLM to iteratively optimize the generated code while maintaining bitwise correctness. Key components: - flattener: traces via make_fx, writes standalone Python files per rank, verifies bitwise equivalence, copies baseline to optimized_models/ - benchmarker: compares optimized vs candidate models for bitwise correctness and MFU, promotes only if >=1% faster on N consecutive runs (default 3) - Shell script wrappers (run_flattener.sh, run_benchmarker.sh) for ergonomic torchrun invocation - INSTRUCTIONS.md guide for LLMs Directory structure uses targets/<fingerprint>/ where fingerprint encodes both hardware label and parallelism config (e.g. h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for self-documenting optimization history. [ghstack-poisoned]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Adds the llm_trainer experiment which traces a model's full
forward+backward training step into a flat sequence of ATen ops,
then provides benchmarking infra for an LLM to iteratively optimize
the generated code while maintaining bitwise correctness.
Key components:
per rank, verifies bitwise equivalence, copies baseline to
optimized_models/
correctness and MFU, promotes only if >=1% faster on N consecutive
runs (default 3)
ergonomic torchrun invocation
Directory structure uses targets// where fingerprint
encodes both hardware label and parallelism config (e.g.
h100-sm90_tp2_fsdp4). Promoted files get an MFU comment header for
self-documenting optimization history.