From 2fb1000e8536b055cbadbc5966170d1b4dcef3dc Mon Sep 17 00:00:00 2001 From: Ivan Basov Date: Thu, 9 Jul 2026 19:33:54 +0000 Subject: [PATCH 1/3] Fix Apache 2.0 open-source compliance issues (OSRB review) Address findings from the OSRB Apache 2.0 compliance review: - LICENSE: add the required NVIDIA copyright line before the Apache 2.0 license text. - Remove Contributor_License_Agreement.md: Apache 2.0 projects use DCO only (documented in CONTRIBUTING.md); a CLA is not permitted. - Replace proprietary NVIDIA headers (LicenseRef-NvidiaProprietary) with the standard Apache-2.0 SPDX header in code/tests/test_dataloader_multiprocessing.py and eight other files found by a full-repo sweep (Dockerfile, four conf yamls, three GitHub workflows). - Fix code/scripts/spdx_headers.py: the hash-style old-header pattern (_OLD_HASH_BODY) had the wrong SPDX identifier line, so the tool never matched or replaced hash-style proprietary headers. Co-Authored-By: Claude Fable 5 Signed-off-by: Ivan Basov --- .github/workflows/ci-gpu.yml | 19 +++-- .github/workflows/long-running-tests.yml | 19 +++-- .github/workflows/pr_file_check.yaml | 19 +++-- Contributor_License_Agreement.md | 70 ------------------- Dockerfile | 14 +++- LICENSE | 1 + code/scripts/spdx_headers.py | 2 +- code/tests/test_dataloader_multiprocessing.py | 19 +++-- ...pre_decoder_memory_surface_model_1_d9.yaml | 14 +++- conf/config_qec_decoder_r13_fp8.yaml | 14 +++- conf/config_qec_decoder_r9_fp8.yaml | 14 +++- conf/config_v3_timing_test.yaml | 19 +++-- 12 files changed, 114 insertions(+), 110 deletions(-) delete mode 100644 Contributor_License_Agreement.md diff --git a/.github/workflows/ci-gpu.yml b/.github/workflows/ci-gpu.yml index f0037c1..27bcbee 100644 --- a/.github/workflows/ci-gpu.yml +++ b/.github/workflows/ci-gpu.yml @@ -1,12 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 # -# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -# property and proprietary rights in and to this material, related -# documentation and any modifications thereto. Any use, reproduction, -# disclosure or distribution of this material and related documentation -# without an express license agreement from NVIDIA CORPORATION or -# its affiliates is strictly prohibited. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # GPU tests live in a separate workflow because NVIDIA self-hosted runners # block pull_request events entirely. Keeping them here avoids a confusing diff --git a/.github/workflows/long-running-tests.yml b/.github/workflows/long-running-tests.yml index a87b653..a7a357c 100644 --- a/.github/workflows/long-running-tests.yml +++ b/.github/workflows/long-running-tests.yml @@ -1,12 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 # -# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -# property and proprietary rights in and to this material, related -# documentation and any modifications thereto. Any use, reproduction, -# disclosure or distribution of this material and related documentation -# without an express license agreement from NVIDIA CORPORATION or -# its affiliates is strictly prohibited. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Long-running GPU tests (20+ min each): statistical validation, # multi-orientation inference, LER regression, and full-epoch training. diff --git a/.github/workflows/pr_file_check.yaml b/.github/workflows/pr_file_check.yaml index 108f347..f20c90c 100644 --- a/.github/workflows/pr_file_check.yaml +++ b/.github/workflows/pr_file_check.yaml @@ -1,12 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 # -# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -# property and proprietary rights in and to this material, related -# documentation and any modifications thereto. Any use, reproduction, -# disclosure or distribution of this material and related documentation -# without an express license agreement from NVIDIA CORPORATION or -# its affiliates is strictly prohibited. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. name: Check for Large Files and Restricted Extensions on: diff --git a/Contributor_License_Agreement.md b/Contributor_License_Agreement.md deleted file mode 100644 index 9d516eb..0000000 --- a/Contributor_License_Agreement.md +++ /dev/null @@ -1,70 +0,0 @@ -# Individual Contributor License Agreement (CLA) - -**Thank you for submitting your contributions to this project.** - -By signing this CLA, you agree that the following terms apply to all of your -past, present and future contributions to the project. - -## License - -You hereby represent that all present, past and future contributions are -governed by the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0) -copyright statement. - -This entails that to the extent possible under law, you transfer all copyright -and related or neighboring rights of the code or documents you contribute to the -project itself or its maintainers. Furthermore you also represent that you have -the authority to perform the above waiver with respect to the entirety of you -contributions. - -## Moral Rights - -To the fullest extent permitted under applicable law, you hereby waive, and -agree not to assert, all of your “moral rights” in or relating to your -contributions for the benefit of the project. - -## Third Party Content - -If your Contribution includes or is based on any source code, object code, bug -fixes, configuration changes, tools, specifications, documentation, data, -materials, feedback, information or other works of authorship that were not -authored by you (“Third Party Content”) or if you are aware of any third party -intellectual property or proprietary rights associated with your Contribution -(“Third Party Rights”), then you agree to include with the submission of your -Contribution full details respecting such Third Party Content and Third Party -Rights, including, without limitation, identification of which aspects of your -Contribution contain Third Party Content or are associated with Third Party -Rights, the owner/author of the Third Party Content and Third Party Rights, -where you obtained the Third Party Content, and any applicable third party -license terms or restrictions respecting the Third Party Content and Third Party -Rights. For greater certainty, the foregoing obligations respecting the -identification of Third Party Content and Third Party Rights do not apply to any -portion of a Project that is incorporated into your Contribution to that same -Project. - -## Representations - -You represent that, other than the Third Party Content and Third Party Rights -identified by you in accordance with this Agreement, you are the sole author of -your Contributions and are legally entitled to grant the foregoing licenses and -waivers in respect of your Contributions. If your Contributions were created in -the course of your employment with your past or present employer(s), you -represent that such employer(s) has authorized you to make your Contributions on -behalf of such employer(s) or such employer (s) has waived all of their right, -title or interest in or to your Contributions. - -## Disclaimer - -To the fullest extent permitted under applicable law, your Contributions are -provided on an "as is" basis, without any warranties or conditions, express or -implied, including, without limitation, any implied warranties or conditions of -non-infringement, merchantability or fitness for a particular purpose. You are -not required to provide support for your Contributions, except to the extent you -desire to provide support. - -## No Obligation - -You acknowledge that the maintainers of this project are under no obligation to -use or incorporate your contributions into the project. The decision to use or -incorporate your contributions into the project will be made at the sole -discretion of the maintainers or their authorized delegates. diff --git a/Dockerfile b/Dockerfile index fd5caf7..d126010 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # Pre-decoder training image. # diff --git a/LICENSE b/LICENSE index d645695..f13d24c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Apache License Version 2.0, January 2004 diff --git a/code/scripts/spdx_headers.py b/code/scripts/spdx_headers.py index ec10fe8..ae217b9 100644 --- a/code/scripts/spdx_headers.py +++ b/code/scripts/spdx_headers.py @@ -67,7 +67,7 @@ # Old proprietary license bodies (year-agnostic, used for replacement) _OLD_HASH_BODY = ( - "# SPDX-License-Identifier: Apache-2.0\n" + "# SPDX-License-Identifier: LicenseRef-NvidiaProprietary\n" "#\n" "# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual\n" "# property and proprietary rights in and to this material, related\n" diff --git a/code/tests/test_dataloader_multiprocessing.py b/code/tests/test_dataloader_multiprocessing.py index c578163..7dbea70 100644 --- a/code/tests/test_dataloader_multiprocessing.py +++ b/code/tests/test_dataloader_multiprocessing.py @@ -1,12 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 # -# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -# property and proprietary rights in and to this material, related -# documentation and any modifications thereto. Any use, reproduction, -# disclosure or distribution of this material and related documentation -# without an express license agreement from NVIDIA CORPORATION or -# its affiliates is strictly prohibited. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. """ Multi-worker DataLoader tests for the Stim inference datapipe. diff --git a/conf/config_pre_decoder_memory_surface_model_1_d9.yaml b/conf/config_pre_decoder_memory_surface_model_1_d9.yaml index a7624f1..405569e 100644 --- a/conf/config_pre_decoder_memory_surface_model_1_d9.yaml +++ b/conf/config_pre_decoder_memory_surface_model_1_d9.yaml @@ -1,5 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. exp_tag: pre-decoder # The shell script always overrides this with "${EXPERIMENT_NAME}" output: outputs/${exp_tag} # Main output directory. diff --git a/conf/config_qec_decoder_r13_fp8.yaml b/conf/config_qec_decoder_r13_fp8.yaml index e3edbf9..8b49614 100644 --- a/conf/config_qec_decoder_r13_fp8.yaml +++ b/conf/config_qec_decoder_r13_fp8.yaml @@ -1,5 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # Config for: Ising-Decoder-SurfaceCode-1-Accurate (R=13), aka Model 4 from the corresponding paper, depolarizing p=0.006, experiment qec-decoder-depolarizing-r13-fp8. # Training uses receptive field 13; evaluation targets distance/n_rounds 13. diff --git a/conf/config_qec_decoder_r9_fp8.yaml b/conf/config_qec_decoder_r9_fp8.yaml index 40c7b27..8ab3455 100644 --- a/conf/config_qec_decoder_r9_fp8.yaml +++ b/conf/config_qec_decoder_r9_fp8.yaml @@ -1,5 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # Config for: Ising-Decoder-SurfaceCode-1-Fast (R=9), aka Model 1 from the corresponding paper, depolarizing p=0.006, experiment qec-decoder-depolarizing-r9-fp8. # Training uses receptive field 9; evaluation targets distance/n_rounds 9. diff --git a/conf/config_v3_timing_test.yaml b/conf/config_v3_timing_test.yaml index 922fd4a..0057ed7 100644 --- a/conf/config_v3_timing_test.yaml +++ b/conf/config_v3_timing_test.yaml @@ -1,12 +1,17 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# SPDX-License-Identifier: Apache-2.0 # -# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -# property and proprietary rights in and to this material, related -# documentation and any modifications thereto. Any use, reproduction, -# disclosure or distribution of this material and related documentation -# without an express license agreement from NVIDIA CORPORATION or -# its affiliates is strictly prohibited. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Timing check config for v3 (Torch HE) branch. # Timing test: d=5, n_rounds=5, 25-param noise model (p=0.006). From 0432a61905e8d748af532ab6f8aec4bd33667d7c Mon Sep 17 00:00:00 2001 From: Ivan Basov Date: Thu, 9 Jul 2026 19:48:00 +0000 Subject: [PATCH 2/3] Make spdx_headers.py --check enforce Apache-2.0 identifier Previously --check only verified that SPDX-FileCopyrightText appears in the first 20 lines, so files carrying a proprietary LicenseRef-NvidiaProprietary header passed CI. This is how proprietary headers survived the PR #19 migration and were reintroduced by later PRs (e.g. #29). Now --check also requires "SPDX-License-Identifier: Apache-2.0" in the header and reports offending files separately, failing the run. Co-Authored-By: Claude Fable 5 Signed-off-by: Ivan Basov --- code/scripts/spdx_headers.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/code/scripts/spdx_headers.py b/code/scripts/spdx_headers.py index ae217b9..e3d8a2d 100644 --- a/code/scripts/spdx_headers.py +++ b/code/scripts/spdx_headers.py @@ -226,6 +226,11 @@ def _has_header(content: str) -> bool: return "SPDX-FileCopyrightText" in prefix +def _has_apache_license(content: str) -> bool: + prefix = "\n".join(content.splitlines()[:20]) + return "SPDX-License-Identifier: Apache-2.0" in prefix + + def _apply_header(path: Path, header: str, style: str) -> bool: raw = path.read_text(encoding="utf-8") @@ -259,7 +264,9 @@ def _apply_header(path: Path, header: str, style: str) -> bool: def main() -> int: parser = argparse.ArgumentParser(description="Add or check SPDX headers.") parser.add_argument( - "--check", action="store_true", help="Fail if any files are missing headers." + "--check", + action="store_true", + help="Fail if any files are missing headers or use a non-Apache-2.0 license.", ) parser.add_argument( "--root", @@ -271,6 +278,7 @@ def main() -> int: year = dt.datetime.now().year missing = [] + wrong_license = [] updated = [] for path in sorted(_iter_files(args.root)): @@ -282,6 +290,8 @@ def main() -> int: raw = path.read_text(encoding="utf-8") if not _has_header(raw): missing.append(path.relative_to(args.root)) + elif not _has_apache_license(raw): + wrong_license.append(path.relative_to(args.root)) else: if _apply_header(path, header, style): updated.append(path.relative_to(args.root)) @@ -290,8 +300,15 @@ def main() -> int: if missing: missing_str = "\n".join(f"- {path}" for path in missing) print("Missing SPDX headers:\n" + missing_str) + if wrong_license: + wrong_str = "\n".join(f"- {path}" for path in wrong_license) + print( + "SPDX headers without 'SPDX-License-Identifier: Apache-2.0':\n" + + wrong_str + ) + if missing or wrong_license: return 1 - print("All checked files have SPDX headers.") + print("All checked files have Apache-2.0 SPDX headers.") return 0 if updated: From c15f75a53cad0a19cc781c890afae9fa507e61a7 Mon Sep 17 00:00:00 2001 From: Ivan Basov Date: Thu, 9 Jul 2026 20:05:20 +0000 Subject: [PATCH 3/3] style: apply YAPF formatting to spdx_headers.py Co-Authored-By: Claude Fable 5 Signed-off-by: Ivan Basov --- code/scripts/spdx_headers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/scripts/spdx_headers.py b/code/scripts/spdx_headers.py index e3d8a2d..4eaa688 100644 --- a/code/scripts/spdx_headers.py +++ b/code/scripts/spdx_headers.py @@ -302,10 +302,7 @@ def main() -> int: print("Missing SPDX headers:\n" + missing_str) if wrong_license: wrong_str = "\n".join(f"- {path}" for path in wrong_license) - print( - "SPDX headers without 'SPDX-License-Identifier: Apache-2.0':\n" - + wrong_str - ) + print("SPDX headers without 'SPDX-License-Identifier: Apache-2.0':\n" + wrong_str) if missing or wrong_license: return 1 print("All checked files have Apache-2.0 SPDX headers.")