Skip to content

Accurate, fast FP4 KV-cache decoding through algorithm-system co-design.

Add MIT license and preserve third-party licensing

DD-DuDa81ecfbdbd9ea
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..ff52cbc
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 BitDecoding-FP4 contributors
+
+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.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..de28897
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,34 @@
+Third-party notices
+===================
+
+The MIT license in LICENSE applies to original BitDecoding-FP4 code.
+Third-party components retain their own copyright notices and licenses.
+
+FlashAttention-derived helpers
+------------------------------
+The helpers under src/nvfp4_decode_kernel/_fa4/ include code derived from
+FlashAttention, except for the NVIDIA helper identified below.
+
+Upstream: https://github.com/Dao-AILab/flash-attention
+License: BSD 3-Clause; see src/nvfp4_decode_kernel/_fa4/LICENSE.
+Upstream authors: see src/nvfp4_decode_kernel/_fa4/AUTHORS and the copyright
+notices retained in the individual source files.
+
+NVIDIA CUTLASS DSL helper
+------------------------
+File: src/nvfp4_decode_kernel/_fa4/block_scaled_layout.py
+Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+This software contains source code provided by NVIDIA Corporation.
+
+This file is governed by the NVIDIA CUTLASS DSL Software License Agreement,
+not the MIT or BSD license grants:
+https://docs.nvidia.com/cutlass/latest/media/docs/pythonDSL/license.html
+
+vLLM submodule
+--------------
+The third_party/vllm submodule is licensed under Apache License 2.0.
+Its license is included at third_party/vllm/LICENSE when the submodule is
+checked out. Third-party components within vLLM retain their own licenses.
+
+Upstream: https://github.com/vllm-project/vllm
diff --git a/README.md b/README.md
index 551fa3c..a724a47 100644
--- a/README.md
+++ b/README.md
@@ -53,3 +53,8 @@ See the [performance benchmark guide](benchmark/README.md) for kernel and e2e-se
## Evaluation
See the [accuracy evaluation guide](evaluation/README.md) for dataset installation and the evaluation benchmarks used in the paper.
+
+## License
+
+Original code is licensed under the [MIT License](LICENSE).
+Third-party components retain their own licenses; see [NOTICE](NOTICE).
diff --git a/pyproject.toml b/pyproject.toml
index 09ff5d3..408f851 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,11 +1,18 @@
[build-system]
-requires = ["setuptools>=64"]
+requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "bitdecoding-fp4-kernel"
version = "0.1.0"
description = "NVFP4 paged-decode kernel interface"
+license = "MIT AND BSD-3-Clause AND LicenseRef-NvidiaProprietary"
+license-files = [
+ "LICENSE",
+ "NOTICE",
+ "src/nvfp4_decode_kernel/_fa4/LICENSE",
+ "src/nvfp4_decode_kernel/_fa4/AUTHORS",
+]
requires-python = ">=3.10"
dependencies = [
"torch",
diff --git a/src/nvfp4_decode_kernel/_fa4/AUTHORS b/src/nvfp4_decode_kernel/_fa4/AUTHORS
new file mode 100644
index 0000000..4ca8b3f
--- /dev/null
+++ b/src/nvfp4_decode_kernel/_fa4/AUTHORS
@@ -0,0 +1 @@
diff --git a/src/nvfp4_decode_kernel/_fa4/LICENSE b/src/nvfp4_decode_kernel/_fa4/LICENSE
new file mode 100644
index 0000000..5860e4b
--- /dev/null
+++ b/src/nvfp4_decode_kernel/_fa4/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* 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.
+
+* 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.
diff --git a/src/nvfp4_decode_kernel/_fa4/block_scaled_layout.py b/src/nvfp4_decode_kernel/_fa4/block_scaled_layout.py
index 8b53c14..89f183e 100644
--- a/src/nvfp4_decode_kernel/_fa4/block_scaled_layout.py
+++ b/src/nvfp4_decode_kernel/_fa4/block_scaled_layout.py
@@ -1,9 +1,11 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
+# This software contains source code provided by NVIDIA Corporation.
+#
# Use of this software is governed by the terms and conditions of the
# NVIDIA End User License Agreement (EULA), available at:
-# https://docs.nvidia.com/cutlass/media/docs/pythonDSL/license.html
+# https://docs.nvidia.com/cutlass/latest/media/docs/pythonDSL/license.html
#
# Any use, reproduction, disclosure, or distribution of this software
# and related documentation outside the scope permitted by the EULA