Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
122ad23
refactor: migrate recurrent state operators
whjthu Oct 12, 2026
40758fd
refactor: migrate int8 quantization operators
whjthu Oct 12, 2026
75161b3
refactor: migrate awq and gptq marlin operators
whjthu Oct 12, 2026
0115367
refactor: retain migrated source attribution
whjthu Oct 12, 2026
6666aaa
refactor: enable native dense inference
whjthu Oct 12, 2026
1055dca
refactor: add general dense and vision operators
whjthu Oct 12, 2026
22440eb
refactor: migrate expert routing and compute
whjthu Oct 12, 2026
06abc07
refactor: support explicit public API-only selections
whjthu Oct 12, 2026
839931e
refactor: integrate minimal Ascend operator providers
whjthu Oct 12, 2026
bdd6098
refactor: integrate minimal Cambricon operator providers
whjthu Oct 12, 2026
c8b3058
fix: preserve dense inference precision and attention selection
whjthu Oct 18, 2026
2e58fbc
fix: isolate optional Marlin builds and document inference dependencies
whjthu Oct 18, 2026
a5cc747
docs: include YAML dependency in inference SDK setup
whjthu Oct 18, 2026
9362510
fix: remove artificial operator qualification limits
whjthu Oct 18, 2026
0739b27
style: align source formatting with CI
whjthu Oct 18, 2026
52d7b33
build: preserve upstream source and redistribution notices
whjthu Oct 19, 2026
254c434
fix: retain optional Marlin public operator interfaces
whjthu Oct 19, 2026
945184c
refactor: simplify migrated providers and pin upstream kernel sources
whjthu Oct 19, 2026
a989fcb
fix: correct native provider and source preparation contracts
whjthu Oct 19, 2026
7ecc523
refactor: simplify native inference source integration
whjthu Oct 19, 2026
0f2d4fa
refactor: share native helpers and unify source archives
whjthu Oct 19, 2026
c86b4f2
refactor: simplify native operators and public SDK dispatch
whjthu Oct 19, 2026
d696f4c
style: format native operator sources
whjthu Oct 20, 2026
bcfe96d
refactor: unify scalar multiplication and padding interfaces
whjthu Oct 20, 2026
f998e4d
fix: relax state pool and rotary metadata constraints
whjthu Oct 20, 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
40 changes: 38 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
cmake_minimum_required(VERSION 3.18)
if(SKBUILD_STATE STREQUAL "sdist")
# Source packaging must not probe compilers, GPUs or installed SDKs.
project(InfiniOps LANGUAGES NONE)
include(cmake/MarlinSource.cmake)
foreach(_marlin_file IN LISTS _marlin_source_files)
configure_file("${vllm_marlin_SOURCE_DIR}/${_marlin_file}"
"${CMAKE_BINARY_DIR}/marlin-source/${_marlin_file}" COPYONLY)
endforeach()
include(cmake/FlashAttentionSource.cmake)
foreach(_flash_file IN LISTS _flash_source_files)
configure_file("${flash_attention_SOURCE_DIR}/${_flash_file}"
"${CMAKE_BINARY_DIR}/flash-attention-source/${_flash_file}" COPYONLY)
endforeach()
configure_file("${flash_attention_cutlass_SOURCE_DIR}/LICENSE.txt"
"${CMAKE_BINARY_DIR}/flash-attention-cutlass-source/LICENSE.txt" COPYONLY)
file(COPY "${flash_attention_cutlass_SOURCE_DIR}/include"
DESTINATION "${CMAKE_BINARY_DIR}/flash-attention-cutlass-source")
return()
endif()
project(InfiniOps LANGUAGES CXX)

if(POLICY CMP0116)
Expand Down Expand Up @@ -26,6 +45,9 @@ option(WITH_ASCEND "Enable Ascend backend" OFF)
option(WITH_TORCH "Enable PyTorch C++ backend" OFF)
option(WITH_LINKED "Enable linked third-party operator backends" OFF)

option(BUILD_NVIDIA_FLASH_INFERENCE "Build pinned Torch-free NVIDIA inference Attention" OFF)
option(BUILD_NVIDIA_W4_MARLIN "Build NVIDIA AWQ/GPTQ Marlin providers (CUDA >= 12.3)" OFF)

option(WITH_NINETOOTHED "Enable NineToothed-generated kernels" OFF)

option(WITH_TRITON "Enable the Triton JIT backend" OFF)
Expand Down Expand Up @@ -188,6 +210,13 @@ if(AUTO_DETECT_DEVICES)
endif()
endif()

if(BUILD_NVIDIA_FLASH_INFERENCE AND NOT WITH_NVIDIA)
message(FATAL_ERROR "Native FlashAttention requires WITH_NVIDIA")
endif()
if(BUILD_NVIDIA_W4_MARLIN AND NOT WITH_NVIDIA)
message(FATAL_ERROR "Marlin requires WITH_NVIDIA")
endif()

if(AUTO_DETECT_BACKENDS)
message(STATUS "Auto-detecting available backends...")

Expand Down Expand Up @@ -239,7 +268,10 @@ if(AUTO_DETECT_BACKENDS)
endif()
endif()

if(WITH_TORCH OR WITH_LINKED)
# A linked backend is not necessarily a Torch backend: TVM-FFI transports
# consume DLPack views and their own runtime. Discover Torch lazily only when
# native Torch wrappers or a selected linked Torch transport need it.
macro(infiniops_find_torch)
if(WITH_MARS AND WITH_TORCH AND WITH_LINKED)
find_package(Python COMPONENTS Interpreter Development.Embed REQUIRED)
else()
Expand Down Expand Up @@ -267,7 +299,7 @@ if(WITH_TORCH OR WITH_LINKED)

if(NOT _torch_result EQUAL 0)
message(FATAL_ERROR
"`WITH_TORCH=ON` or `WITH_LINKED=ON` requires an installed `torch` package.")
"The selected Torch backend/transport requires an installed `torch` package.")
endif()

execute_process(
Expand Down Expand Up @@ -360,6 +392,10 @@ if(WITH_TORCH OR WITH_LINKED)
endif()

message(STATUS "Found PyTorch: ${TORCH_INCLUDE_DIRS}")
endmacro()

if(WITH_TORCH)
infiniops_find_torch()
endif()

# Only one CUDA-like GPU backend can be enabled at a time.
Expand Down
30 changes: 30 additions & 0 deletions LICENSES/Apache-2.0-components.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Apache-2.0 components in the fixed native sampling/runtime recipe

The complete common Apache License, Version 2.0, including sections 1-9 and
the application appendix, is in repository LICENSE, installed beside this file
as share/licenses/InfiniOps/LICENSE. Distribute it with these copyrights,
the original project NOTICE files and the applicable secondary terms.
This is not a notice inventory for complete Python wheels or arbitrary binaries.

FlashInfer 0.6.7
https://github.com/flashinfer-ai/flashinfer/tree/v0.6.7
Commit: 56ed54098411946525da17eca2bcfd7ec72a515e
Copyright 2025-2026 NVIDIA
Copyright 2023-2026 FlashInfer community (https://flashinfer.ai/)
Native source headers also retain Copyright (c) 2023, 2024, 2025 and 2026 by
FlashInfer team. Shared terms: LICENSE. Original NOTICE: FlashInfer-0.6.7/NOTICE.txt.

Apache TVM FFI 0.1.10
https://github.com/apache/tvm-ffi/tree/v0.1.10
Commit: 1fed0ae0421e614d45662e8ee6bcae353d3ab2ea
Copyright 2024-present The Apache Software Foundation
Shared terms: LICENSE. Original NOTICE: TVM-FFI-0.1.10/NOTICE.txt.

DLPack: Copyright 2017 by Contributors
Shared Apache-2.0 terms: LICENSE. Its interfaces are used by the native runtime.
libbacktrace: original complete copyright and BSD-3-Clause terms retained in
TVM-FFI-0.1.10/LICENSE.libbacktrace.txt; retain them for the optional compiled support.
CUDA toolkit supplied headers/libraries remain subject to their own applicable
redistribution terms; this list does not replace those materials.

Source scope and resolved-package redistribution: repository THIRD_PARTY.txt.
34 changes: 34 additions & 0 deletions LICENSES/CUTLASS-BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Copyright (c) 2017 - 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Certain files within this repository are subject to separate licensing terms:

- The files located in the `python/CuTeDSL` directory are licensed under the
NVIDIA End User License Agreement (EULA). Please refer to
https://docs.nvidia.com/cutlass/media/docs/pythonDSL/license.html
for the full terms.
27 changes: 27 additions & 0 deletions LICENSES/FasterTransformer-BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8 changes: 8 additions & 0 deletions LICENSES/FlashInfer-0.6.7/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FlashInfer
Copyright 2025-2026 NVIDIA
Copyright 2023-2026 FlashInfer community (https://flashinfer.ai/)

-------------------------------------------------------------------------------------------------
Some of the code in this project are adapted from other open-source projects with different
licenses. This product also bundles some third-party components under other open source licenses.
See licenses/ for text of these licenses.
8 changes: 8 additions & 0 deletions LICENSES/InfiniCore-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The MIT License (MIT)
Copyright © 2025 InfiniTensor

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 changes: 29 additions & 0 deletions LICENSES/TVM-FFI-0.1.10/LICENSE.libbacktrace.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2012-2016 Free Software Foundation, Inc.

# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:

# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.

# (2) Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.

# (3) The name of the author may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions LICENSES/TVM-FFI-0.1.10/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Apache TVM FFI
Copyright 2024-present The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ InfiniOps extension so `import infini.ops` can load its runtime dependency.
| `-DWITH_CAMBRICON=[ON\|OFF]` | Compile the Cambricon implementation | OFF |
| `-DWITH_ASCEND=[ON\|OFF]` | Compile the Ascend implementation | OFF |
| `-DWITH_TORCH=[ON\|OFF]` | Compile generated PyTorch ATen-backed operators | OFF |
| `-DBUILD_NVIDIA_W4_MARLIN=[ON\|OFF]` | Build AWQ/GPTQ Marlin providers; requires CUDA >= 12.3 and C++20 | OFF |
| `-DAUTO_DETECT_DEVICES=[ON\|OFF]` | Auto-detect available platforms | ON |
| `-DINFINI_RT_ROOT=<path>` | InfiniRT install prefix containing `include/` and `lib/` | `$INFINI_RT_ROOT` |

Expand Down
Loading
Loading