Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5465d8b
Replace chunked FLA with recurrent gated delta rule for T=1 decode
Gasoonjia Apr 2, 2026
a6ebe8a
Runtime dispatch: recurrent (T=1) vs chunked (T>1) inside triton_op
Gasoonjia Apr 3, 2026
fc5018e
Revert model.py, export.py, main.cpp to main branch
Gasoonjia Apr 3, 2026
c90a8e8
Add tests for recurrent (T=1) and multi-T dispatch
Gasoonjia Apr 3, 2026
ce3e9ca
lint fix - 2
Gasoonjia Apr 3, 2026
8d35c65
lint fix - 2
Gasoonjia Apr 3, 2026
709deb0
Merge branch 'main' into recurrent-fla
Gasoonjia Apr 3, 2026
eff976d
lint fix - 3
Gasoonjia Apr 3, 2026
7dd4280
Optimize recurrent kernel: parallelize over V tiles
Gasoonjia Apr 3, 2026
3a1ee31
Dual-method PTE with GPU-resident state for Qwen3.5 MoE
Apr 5, 2026
63c162e
Use share_mutable_buffers to eliminate select_scatter overhead
Apr 6, 2026
47d6b98
Merge branch 'main' into recurrent-fla
Gasoonjia Apr 6, 2026
375e5c0
lint
Gasoonjia Apr 6, 2026
2b36797
remove reduntdant updates
Gasoonjia Apr 6, 2026
c06d58b
Cross-method AOTI constant sharing for KV cache
Apr 7, 2026
6945b2a
Fix cross-method AOTI constant sharing and add dual-method runner
Gasoonjia Apr 7, 2026
ea51d0d
Remove debug printf and decode_only flag
Gasoonjia Apr 7, 2026
a0a62f1
Lint formatting fixes
Gasoonjia Apr 7, 2026
ca69871
Improve CUDA backend error handling and add dual-method runner fallback
Apr 9, 2026
7c148f7
Add CUDA graph capture/replay for decode method
Apr 10, 2026
ee75c2e
Merge branch 'main' into cuda-graph
Gasoonjia Apr 10, 2026
10e7aad
lint and reformat
Gasoonjia Apr 13, 2026
9042f36
Merge branch 'main' into cuda-graph
Gasoonjia Apr 13, 2026
84d1587
Merge branch 'main' into cuda-graph
Gasoonjia Apr 15, 2026
e00a499
solve claude
Gasoonjia Apr 15, 2026
aa7bb82
Merge branch 'main' into cuda-graph
Gasoonjia Apr 15, 2026
cef386b
Merge branch 'main' into cuda-graph
Gasoonjia Apr 15, 2026
2d32422
Merge branch 'main' into cuda-graph
Gasoonjia Apr 16, 2026
1270870
Merge branch 'main' into cuda-graph
Gasoonjia Apr 16, 2026
8fc7355
solve stride out of scope
Gasoonjia Apr 17, 2026
2c46ed2
Merge branch 'main' into cuda-graph
Gasoonjia Apr 21, 2026
855eb93
Merge branch 'main' into cuda-graph
Gasoonjia Apr 22, 2026
4237d17
remove unused env var
Gasoonjia Apr 22, 2026
9b4705e
Merge branch 'main' into cuda-graph
Gasoonjia Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/scripts/test_model_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ EOF
fi
;;
qwen3_5_moe)
RUNNER_ARGS="$RUNNER_ARGS --tokenizer_path ${MODEL_DIR}/$TOKENIZER_FILE --prompt 'What is the capital of France?' --max_new_tokens 128 --temperature 0"
RUNNER_ARGS="$RUNNER_ARGS --tokenizer_path ${MODEL_DIR}/$TOKENIZER_FILE --prompt 'What is the capital of France?' --max_new_tokens 128 --temperature 0 --cuda_graph"
# CUDA graph capture requires cudaMallocAsync backend for stream-ordered allocations
export PYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsync
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it have to be specified here, can we enable it internally when user specifies --cuda_graph?

;;
voxtral_realtime)
RUNNER_ARGS="--model_path ${MODEL_DIR}/model.pte --tokenizer_path ${MODEL_DIR}/$TOKENIZER_FILE --preprocessor_path ${MODEL_DIR}/$PREPROCESSOR --audio_path ${MODEL_DIR}/$AUDIO_FILE --temperature 0"
Expand Down
53 changes: 53 additions & 0 deletions backends/aoti/aoti_delegate_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ using AOTInductorModelContainerHandle = AOTInductorModelContainerOpaque*;
using AOTInductorStreamHandle = void*;
using AOTIProxyExecutorHandle = void*;

// Opaque types for AOTI constant management.
// AtenTensorOpaque wraps at::Tensor* in the AOTI runtime — distinct from
// AOTITensorHandle which wraps executorch::runtime::etensor::Tensor*.
struct AtenTensorOpaque;
using AtenTensorHandle = AtenTensorOpaque*;

struct AOTInductorConstantMap;
using AOTInductorConstantMapHandle = AOTInductorConstantMap*;

struct AOTInductorConstantMapEntry {
const char* name;
AtenTensorHandle handle;
};

// Function pointer types for AOT Inductor model container operations
using AOTInductorModelContainerCreateWithDeviceFunc = AOTIRuntimeError (*)(
AOTInductorModelContainerHandle* container_handle,
Expand Down Expand Up @@ -77,6 +91,37 @@ using AOTInductorModelUpdateConstantsFromBlobFunc = AOTIRuntimeError (*)(
AOTInductorModelContainerHandle container_handle,
const uint8_t* weight_blob_ptr);

// Retrieves a constant's AOTI internal name by index.
using AOTInductorModelContainerGetConstantNameFunc = AOTIRuntimeError (*)(
AOTInductorModelContainerHandle container_handle,
size_t idx,
const char** name);

// Retrieves a constant's original fully-qualified name by index.
using AOTInductorModelContainerGetConstantOriginalFQNFunc =
AOTIRuntimeError (*)(
AOTInductorModelContainerHandle container_handle,
size_t idx,
const char** original_fqn);

// Extracts the constants map from the container (active or inactive buffer).
// constant_map_handle should point to a
// std::unordered_map<std::string, AtenTensorHandle>.
using AOTInductorModelContainerExtractConstantsMapFunc = AOTIRuntimeError (*)(
AOTInductorModelContainerHandle container_handle,
AOTInductorConstantMapHandle constant_map_handle,
bool use_inactive);

// Updates the container's constants with user-managed tensor handles.
// DLL-boundary safe — uses a flat C array instead of std::unordered_map.
using AOTInductorModelContainerUpdateUserManagedConstantBufferPairsFunc =
AOTIRuntimeError (*)(
AOTInductorModelContainerHandle container_handle,
const AOTInductorConstantMapEntry* pairs,
size_t num_pairs,
bool use_inactive,
bool validate_full_update);

} // extern "C"

// AOTI Delegate Handle structure
Expand All @@ -93,6 +138,14 @@ struct AOTIDelegateHandle {
AOTInductorModelContainerGetNumOutputsFunc get_num_outputs;
AOTInductorModelContainerRunFunc run;
AOTInductorModelUpdateConstantsFromBlobFunc update_constants_from_blob;

// Constant management function pointers (for cross-method buffer sharing)
AOTInductorModelContainerGetNumConstantsFunc get_num_constants;
AOTInductorModelContainerGetConstantNameFunc get_constant_name;
AOTInductorModelContainerGetConstantOriginalFQNFunc get_constant_original_fqn;
AOTInductorModelContainerExtractConstantsMapFunc extract_constants_map;
AOTInductorModelContainerUpdateUserManagedConstantBufferPairsFunc
update_user_managed_constant_buffer_pairs;
};

} // namespace aoti
Expand Down
Loading
Loading