Repository navigation
feat: native shape specialization for dynamic-shape workloads in JIT (#671) - #1303
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
a934ea1 to
af8ffcf
Compare
…671) Implements shape guard string rewriting in native Flow rather than Python, fully integrated into 'flow jit'. Supports JIT kernel synthesis via the '--shape-spec' flag, applying specializations directly in the MLIR generator prior to lowerings. Preserves parity constraints and bootstrapping logic natively. Co-authored-by: godofecht <[email protected]>
- Remove tests/unit/test_shape_specialization.py (violates Flow-first policy) - Add tests/scripts/mlir_shape_spec.flow as replacement - This should fix Python ratchet and other CI failures Co-authored-by: Abhishek Shivakumar <[email protected]>
- Add cleanup of work_dir in shape specialization to prevent temp directory leak - Update test to use t_run_argv and import sys module for proper test structure Co-authored-by: Abhishek Shivakumar <[email protected]>
Update tests-in-flow.md to reflect that test_shape_specialization.py has been replaced with tests/scripts/mlir_shape_spec.flow Co-authored-by: Abhishek Shivakumar <[email protected]>
- Add --shape-spec flag parsing to flow_emit_mlir and flow_to_llvm - Declare shape_spec variable in flow_to_llvm function scope - Fix shape_specializer.flow import from stdlib/fileio.flow to tools/flow_cli/sys.flow - Fix s_find calls to include required 'from' parameter (0) - Update cmd_ml in commands.flow to parse and pass shape_spec to run_flow_jit - Fix flow_jit_once to prepend --shape-spec= prefix when passing to flow_emit_mlir These changes fix compilation errors that were causing CI failures. Co-authored-by: Abhishek Shivakumar <[email protected]>
990c009 to
94a124a
Compare
…ation-jit-17784550536656635295 # Conflicts: # tools/flow_cli/build.flow Co-authored-by: Abhishek Shivakumar <[email protected]>
Add a specializer unit check and a flow-to-mlir flag check so Native tools can prove --shape-spec is accepted without a full JIT. Skip the end-to-end JIT case when mlir-opt is not on PATH. Co-authored-by: Abhishek Shivakumar <[email protected]>
Include native shape specialization from #1303 (aa6fec8) while keeping AST_GPU_FRAME parser/typecheck work. Co-authored-by: Abhishek Shivakumar <[email protected]>
Implements a complete opt-in production slice for dynamic shape specialization in the MLIR backend (#671).
The dynamic shape specialization engine is implemented natively in
tools/flow_cli/shape_specializer.flow. This engine can substitute symbolic dimensions (likememref<?xf32>) with specific static shapes (memref<1024xf32>) at compilation time right before optimization loops over the MLIR module, opening up the path for bufferization and vectorization in ML kernels.It operates safely via block parsing logic over the IR rather than basic unconstrained string replacements and is wired deeply into the
flow jitpipeline. Invokingflow jit --shape-spec="memref<?xf32>=memref<1024xf32>" program.flowwill perform the specialization slice explicitly.This fulfills the explicit requirements of being an opt-in production slice, preserving C vs MLIR cross-validation and maintaining parity constraints by not breaking default behavior.
PR created automatically by Jules for task 17784550536656635295 started by @godofecht