diff --git a/qwen3_6_scripts/ix_full_bridge.cpp b/qwen3_6_scripts/ix_full_bridge.cpp index f5396150..080b2e97 100644 --- a/qwen3_6_scripts/ix_full_bridge.cpp +++ b/qwen3_6_scripts/ix_full_bridge.cpp @@ -46,9 +46,9 @@ torch::Tensor ixinfer_flash_attn_unpad_with_block_tables( double scale, double softcap, bool sqrt_alibi, - const std::optional& alibi_slopes, - const std::optional& sinks, - std::optional& lse); + const c10::optional& alibi_slopes, + const c10::optional& sinks, + c10::optional& lse); torch::Tensor xllm_paged_attention( torch::Tensor& out, @@ -61,14 +61,14 @@ torch::Tensor xllm_paged_attention( torch::Tensor& context_lens, int64_t block_size, int64_t max_context_len, - const std::optional& alibi_slopes, + const c10::optional& alibi_slopes, bool causal, int32_t window_left, int32_t window_right, double softcap, bool enable_cuda_graph, bool use_sqrt_alibi, - const std::optional& sinks); + const c10::optional& sinks); // --- Activation --- void silu_and_mul(torch::Tensor& input, torch::Tensor& output); @@ -77,9 +77,9 @@ void silu_and_mul(torch::Tensor& input, torch::Tensor& output); torch::Tensor ixformer_linear(torch::Tensor& input, torch::Tensor& weight, int64_t act_type, - const std::optional& bias, - const std::optional& out, - const std::optional persistent); + const c10::optional& bias, + const c10::optional& out, + const c10::optional persistent); torch::Tensor ixformer_linear_ex(torch::Tensor& input, torch::Tensor& weight, @@ -109,7 +109,7 @@ void residual_rms_norm(torch::Tensor& input, torch::Tensor& weight, torch::Tensor& output, torch::Tensor& residual_output, - const std::optional& fused_bias, + const c10::optional& fused_bias, double alpha, double eps, bool is_post); @@ -117,7 +117,7 @@ void residual_rms_norm(torch::Tensor& input, void rms_norm(torch::Tensor& input, torch::Tensor& weight, torch::Tensor& output, - const std::optional& fused_bias, + const c10::optional& fused_bias, double eps); // --- MoE --- @@ -261,7 +261,7 @@ torch::Tensor ix_flash_attn_prefill( int64_t max_query_len, int64_t max_seq_len, double scale, bool is_causal, int64_t window_left, int64_t window_right) { - std::optional lse = std::nullopt; + c10::optional lse = std::nullopt; return ixformer::infer::ixinfer_flash_attn_unpad_with_block_tables( query, key_cache, value_cache, output, block_tables, cu_seq_q, cu_seq_k, max_query_len, max_seq_len, diff --git a/qwen3_6_scripts/ix_moe_bridge.cpp b/qwen3_6_scripts/ix_moe_bridge.cpp index 6e294984..3c228580 100644 --- a/qwen3_6_scripts/ix_moe_bridge.cpp +++ b/qwen3_6_scripts/ix_moe_bridge.cpp @@ -17,7 +17,7 @@ #include #include -static const std::optional kNoneTensor = {}; +static const c10::optional kNoneTensor = {}; // Forward-declare ixformer C++ API (from base image SDK) namespace ixformer { @@ -34,9 +34,9 @@ void moe_compute_token_index_api( torch::Tensor& src_dst, torch::Tensor& dst_src, torch::Tensor& expert_sizes_gpu, - const std::optional& expert_mask, - const std::optional& expert_sizes_cpu, - const std::optional& expand_tokens_gpu, + const c10::optional& expert_mask, + const c10::optional& expert_sizes_cpu, + const c10::optional& expand_tokens_gpu, int64_t start_expert_id, int64_t end_expert_id, int64_t num_experts); @@ -44,7 +44,7 @@ void moe_compute_token_index_api( void moe_expand_input(torch::Tensor outputs, torch::Tensor inputs, torch::Tensor dst_to_src, - const std::optional& src_to_dst, + const c10::optional& src_to_dst, int64_t dst_tokens, int64_t expand_factor); @@ -52,17 +52,17 @@ void moe_w16a16_group_gemm(torch::Tensor output, torch::Tensor inputs, torch::Tensor weights, torch::Tensor tokens_per_experts, - const std::optional& dst_to_src, - const std::optional& bias, + const c10::optional& dst_to_src, + const c10::optional& bias, std::string format, int64_t persistent, int64_t output_n); void moe_output_reduce_sum(torch::Tensor outputs, torch::Tensor inputs, - const std::optional& mul_weight, - const std::optional& mask, - const std::optional& extra_residual, + const c10::optional& mul_weight, + const c10::optional& mask, + const c10::optional& extra_residual, double scaling_factor); void silu_and_mul(torch::Tensor& input, torch::Tensor& output);