Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
url = https://github.com/NVIDIA-NeMo/Gym.git
branch = main
shallow = true
[submodule "3rdparty/NV-One-Logger-workspace/nv-one-logger"]
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't be needed

path = 3rdparty/NV-One-Logger-workspace/nv-one-logger
url = [email protected]:NVIDIA/nv-one-logger.git
Comment on lines +21 to +23
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .gitmodules

Repository: NVIDIA-NeMo/RL

Length of output: 1102


🏁 Script executed:

curl -s -o /dev/null -w "%{http_code}" https://github.com/NVIDIA/nv-one-logger

Repository: NVIDIA-NeMo/RL

Length of output: 61


Add branch and shallow clone configuration for consistency.

The new submodule entry lacks branch and shallow properties that are present in all four existing submodules. Additionally, it uses an SSH URL instead of HTTPS like all other NVIDIA submodules. This creates inconsistency and may lead to unintended behavior:

  1. Without shallow = true, the submodule will perform full clones instead of shallow clones, increasing download size and time.
  2. Without a branch specification, the submodule will track HEAD rather than a stable, pinned branch.
  3. The SSH URL ([email protected]:) differs from the HTTPS URLs used for all other NVIDIA submodules in this file.

Apply this diff to align with existing submodule configurations:

 [submodule "3rdparty/NV-One-Logger-workspace/nv-one-logger"]
 	path = 3rdparty/NV-One-Logger-workspace/nv-one-logger
-	url = [email protected]:NVIDIA/nv-one-logger.git
+	url = https://github.com/NVIDIA/nv-one-logger.git
+	branch = main
+	shallow = true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[submodule "3rdparty/NV-One-Logger-workspace/nv-one-logger"]
path = 3rdparty/NV-One-Logger-workspace/nv-one-logger
url = [email protected]:NVIDIA/nv-one-logger.git
[submodule "3rdparty/NV-One-Logger-workspace/nv-one-logger"]
path = 3rdparty/NV-One-Logger-workspace/nv-one-logger
url = https://github.com/NVIDIA/nv-one-logger.git
branch = main
shallow = true
🤖 Prompt for AI Agents
In .gitmodules around lines 21-23, the NV-One-Logger submodule entry is missing
the branch and shallow settings and uses an SSH URL; update the entry to match
the other NVIDIA submodules by changing the URL to the HTTPS form, adding a
branch line matching the other NVIDIA submodules (e.g., branch = main or the
same branch used by the other entries), and add shallow = true so the submodule
is shallow-cloned.

21 changes: 21 additions & 0 deletions 3rdparty/NV-One-Logger-workspace/is_nvlogger_installed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# 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.
try:
import nv_one_logger # noqa: F401

INSTALLED = True
except ImportError:
INSTALLED = False

print(f"NV One Logger {INSTALLED=}")
1 change: 1 addition & 0 deletions 3rdparty/NV-One-Logger-workspace/nv-one-logger
Submodule nv-one-logger added at c382dd
9 changes: 9 additions & 0 deletions 3rdparty/NV-One-Logger-workspace/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = ["setuptools", "wheel", "toml"]
build-backend = "setuptools.build_meta"

[project]
name = "nv-one-logger-core"
description = "Wrapper for nv-one-logger-core"
requires-python = ">=3.8"
dynamic = ["version", "dependencies"]
59 changes: 59 additions & 0 deletions 3rdparty/NV-One-Logger-workspace/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
import toml
from pathlib import Path
import setuptools
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Missing NVIDIA copyright header and unused import.

Same issues as the wrapper setup.py files: add the NVIDIA copyright header and remove the unused sys import. As per coding guidelines for Python files.

Apply this diff:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# 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.
+
-import sys
 import toml
 from pathlib import Path
 import setuptools
🤖 Prompt for AI Agents
In 3rdparty/NV-One-Logger-workspace/setup.py around lines 1-4, the file is
missing the required NVIDIA copyright header and contains an unused import of
sys; remove the unused "import sys" line and prepend the standard NVIDIA
copyright header comment block at the top of the file (matching other wrapper
setup.py files in the repo) so the file begins with the header followed by the
remaining imports (toml, Path, setuptools).


# Define the source directory for the actual package (git-cloned repo)
src_dir = Path(__file__).parent / "nv-one-logger" / "nv_one_logger" / "one_logger_core"

if not src_dir.exists():
raise FileNotFoundError(f"{src_dir} not found.")

# Read the underlying pyproject.toml
pyproject_toml_path = src_dir / "pyproject.toml"
with pyproject_toml_path.open("r") as f:
pyproject_data = toml.load(f)

# Extract dependencies
# Handle poetry dependencies format
poetry_deps = pyproject_data.get("tool", {}).get("poetry", {}).get("dependencies", {})
install_requires = []
for pkg, ver in poetry_deps.items():
if pkg == "python":
continue
# Simple conversion, might need more robust handling for complex version strings
# but sufficient for this specific repo's needs
if isinstance(ver, str):
if ver.startswith("^"):
install_requires.append(f"{pkg}>={ver[1:]}")
else:
install_requires.append(f"{pkg}=={ver}")
elif isinstance(ver, dict):
# Handle cases like {version = "...", markers = "..."} if present
if "version" in ver:
version_spec = ver['version']
# If version already has operators (>=, ==, etc.), use as-is
if any(op in version_spec for op in ['>=', '<=', '==', '!=', '~=', '>', '<']):
install_requires.append(f"{pkg}{version_spec}")
else:
install_requires.append(f"{pkg}>={version_spec}")

# Extract version
version = pyproject_data.get("tool", {}).get("poetry", {}).get("version", "0.0.0")

# Map the package directory
# The package name in source is 'nv_one_logger' (from src directory in one_logger_core)
# one_logger_core/src/nv_one_logger
package_dir = {
"": str(src_dir / "src")
}
packages = setuptools.find_packages(where=str(src_dir / "src"))

setuptools.setup(
name="nv-one-logger-core",
version=version,
description="Wrapper for nv-one-logger-core",
packages=packages,
package_dir=package_dir,
install_requires=install_requires,
)
Copy link
Contributor

@terrykong terrykong Dec 15, 2025

Choose a reason for hiding this comment

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

so for all the one logger dependencies, can we switch to VCS installs in pyproject.toml? see https://github.com/NVIDIA-NeMo/RL/blob/main/pyproject.toml#L154 for example

for context, the 3rdparty repo contains dependencies we expect to change a lot and require us to edit the code to have a monorepo experience. considering logging is probably not something we will change very often, i think it will be easier to maintain this as a regular python package.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = ["setuptools", "wheel", "toml"]
build-backend = "setuptools.build_meta"

[project]
name = "nv-one-logger-otel"
description = "Wrapper for nv-one-logger-otel"
requires-python = ">=3.8"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent Python version requirement.

The requires-python = ">=3.8" setting is inconsistent with the root pyproject.toml which specifies requires-python = ">=3.12" (line 16) and the coding guidelines which require Python 3.12+ conformance. This could allow installation in unsupported Python environments.

Apply this diff to align with project standards:

-requires-python = ">=3.8"
+requires-python = ">=3.12"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
requires-python = ">=3.8"
requires-python = ">=3.12"
🤖 Prompt for AI Agents
In 3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-otel/pyproject.toml
around line 8, update the Python requirement from ">=3.8" to ">=3.12" to match
the root pyproject.toml and project guidelines; edit the requires-python field
to ">=3.12" so the package cannot be installed on older, unsupported Python
versions and ensure any related CI/metadata remains consistent.

dynamic = ["version", "dependencies"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
import toml
from pathlib import Path
import setuptools
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Missing NVIDIA copyright header and unused import.

Per coding guidelines, Python files require the NVIDIA copyright header. Also, sys is imported but never used.

Apply this diff:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# 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.
+
-import sys
 import toml
 from pathlib import Path
 import setuptools
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import sys
import toml
from pathlib import Path
import setuptools
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# 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.
import toml
from pathlib import Path
import setuptools
🤖 Prompt for AI Agents
In 3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-otel/setup.py lines
1-4, the file is missing the required NVIDIA copyright header and imports an
unused module (`sys`); add the standard NVIDIA Python file header comment block
at the very top of the file and remove the unused `import sys` line so the file
only imports required modules (toml, Path, setuptools). Ensure the header is
placed before any imports and keep the remaining imports unchanged.


# Define the source directory for the actual package (git-cloned repo)
src_dir = Path(__file__).parent.parent.parent / "nv-one-logger" / "nv_one_logger" / "one_logger_otel"

if not src_dir.exists():
raise FileNotFoundError(f"{src_dir} not found.")

# Read the underlying pyproject.toml
pyproject_toml_path = src_dir / "pyproject.toml"
with pyproject_toml_path.open("r") as f:
pyproject_data = toml.load(f)

# Extract dependencies
# Handle poetry dependencies format
poetry_deps = pyproject_data.get("tool", {}).get("poetry", {}).get("dependencies", {})
install_requires = []
for pkg, ver in poetry_deps.items():
if pkg == "python":
continue
# Simple conversion, might need more robust handling for complex version strings
# but sufficient for this specific repo's needs
if isinstance(ver, str):
if ver.startswith("^"):
install_requires.append(f"{pkg}>={ver[1:]}")
else:
install_requires.append(f"{pkg}=={ver}")
elif isinstance(ver, dict):
# Handle cases like {version = "...", markers = "..."} if present
if "version" in ver:
version_spec = ver['version']
# If version already has operators (>=, ==, etc.), use as-is
if any(op in version_spec for op in ['>=', '<=', '==', '!=', '~=', '>', '<']):
install_requires.append(f"{pkg}{version_spec}")
else:
install_requires.append(f"{pkg}>={version_spec}")

# Extract version
version = pyproject_data.get("tool", {}).get("poetry", {}).get("version", "0.0.0")

# Map the package directory
# The package name in source is 'nv_one_logger' (from src directory in one_logger_otel)
# one_logger_otel/src/nv_one_logger
package_dir = {
"": str(src_dir / "src")
}
packages = setuptools.find_packages(where=str(src_dir / "src"))

setuptools.setup(
name="nv-one-logger-otel",
version=version,
description="Extensions to onelogger library to use Open telemetry (OTEL) as a backend.",
packages=packages,
package_dir=package_dir,
install_requires=install_requires,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = ["setuptools", "wheel", "toml"]
build-backend = "setuptools.build_meta"

[project]
name = "nv-one-logger-training-telemetry"
description = "Wrapper for nv-one-logger-training-telemetry"
requires-python = ">=3.8"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent Python version requirement.

The requires-python = ">=3.8" setting is inconsistent with the root pyproject.toml which specifies requires-python = ">=3.12" (line 16) and the coding guidelines which require Python 3.12+ conformance.

Apply this diff to align with project standards:

-requires-python = ">=3.8"
+requires-python = ">=3.12"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
requires-python = ">=3.8"
requires-python = ">=3.12"
🤖 Prompt for AI Agents
In
3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-training-telemetry/pyproject.toml
around line 8, the requires-python is set to ">=3.8" which conflicts with the
repo standard of ">=3.12"; update the requires-python field to ">=3.12" to match
the root pyproject and project coding guidelines so the package declares Python
3.12+ compatibility.

dynamic = ["version", "dependencies"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
import toml
from pathlib import Path
import setuptools
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Missing NVIDIA copyright header and unused import.

Same issues as other wrappers: add the NVIDIA copyright header and remove the unused sys import. As per coding guidelines for Python files.

Apply this diff:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# 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.
+
-import sys
 import toml
 from pathlib import Path
 import setuptools
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import sys
import toml
from pathlib import Path
import setuptools
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# 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.
import toml
from pathlib import Path
import setuptools
🤖 Prompt for AI Agents
In
3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-training-telemetry/setup.py
lines 1-4, the file is missing the required NVIDIA copyright header and contains
an unused import of sys; remove the unused "import sys" line and add the
standard NVIDIA copyright header comment block at the top of the file (above all
imports) following project guidelines, leaving the remaining imports (toml,
Path, setuptools) intact.


# Define the source directory for the actual package (git-cloned repo)
src_dir = Path(__file__).parent.parent.parent / "nv-one-logger" / "nv_one_logger" / "one_logger_training_telemetry"

if not src_dir.exists():
raise FileNotFoundError(f"{src_dir} not found.")

# Read the underlying pyproject.toml
pyproject_toml_path = src_dir / "pyproject.toml"
with pyproject_toml_path.open("r") as f:
pyproject_data = toml.load(f)

# Extract dependencies
# Handle poetry dependencies format
poetry_deps = pyproject_data.get("tool", {}).get("poetry", {}).get("dependencies", {})
install_requires = []
for pkg, ver in poetry_deps.items():
if pkg == "python":
continue
# Simple conversion, might need more robust handling for complex version strings
# but sufficient for this specific repo's needs
if isinstance(ver, str):
if ver.startswith("^"):
install_requires.append(f"{pkg}>={ver[1:]}")
else:
install_requires.append(f"{pkg}=={ver}")
elif isinstance(ver, dict):
# Handle cases like {version = "...", markers = "..."} if present
if "version" in ver:
version_spec = ver['version']
# If version already has operators (>=, ==, etc.), use as-is
if any(op in version_spec for op in ['>=', '<=', '==', '!=', '~=', '>', '<']):
install_requires.append(f"{pkg}{version_spec}")
else:
install_requires.append(f"{pkg}>={version_spec}")

# Extract version
version = pyproject_data.get("tool", {}).get("poetry", {}).get("version", "0.0.0")

# Map the package directory
# The package name in source is 'nv_one_logger' (from src directory in one_logger_training_telemetry)
# one_logger_training_telemetry/src/nv_one_logger
package_dir = {
"": str(src_dir / "src")
}
packages = setuptools.find_packages(where=str(src_dir / "src"))

setuptools.setup(
name="nv-one-logger-training-telemetry",
version=version,
description="Training job telemetry using OneLogger library.",
packages=packages,
package_dir=package_dir,
install_requires=install_requires,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = ["setuptools", "wheel", "toml"]
build-backend = "setuptools.build_meta"

[project]
name = "nv-one-logger-wandb"
description = "Wrapper for nv-one-logger-wandb"
requires-python = ">=3.9"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent Python version requirement.

The requires-python = ">=3.9" setting is inconsistent with the root pyproject.toml which specifies requires-python = ">=3.12" (line 16) and the coding guidelines which require Python 3.12+ conformance.

Apply this diff to align with project standards:

-requires-python = ">=3.9"
+requires-python = ">=3.12"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
requires-python = ">=3.9"
requires-python = ">=3.12"
🤖 Prompt for AI Agents
In 3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-wandb/pyproject.toml
around line 8, the requires-python is set to ">=3.9" which conflicts with the
root pyproject and project guidelines; update the requires-python value to
">=3.12" to match the root configuration and ensure Python 3.12+ conformance
across the repo.

dynamic = ["version", "dependencies"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
import toml
from pathlib import Path
import setuptools
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Missing NVIDIA copyright header and unused import.

Same issues as the otel wrapper: add the NVIDIA copyright header and remove the unused sys import. As per coding guidelines for Python files.

Apply this diff:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# 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.
+
-import sys
 import toml
 from pathlib import Path
 import setuptools
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import sys
import toml
from pathlib import Path
import setuptools
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# 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.
import toml
from pathlib import Path
import setuptools
🤖 Prompt for AI Agents
In 3rdparty/NV-One-Logger-workspace/wrappers/nv-one-logger-wandb/setup.py lines
1-4, the file is missing the required NVIDIA copyright header and contains an
unused sys import; add the standard NVIDIA copyright header comment block at the
top of the file and remove the unused "import sys" line, keeping the remaining
imports (toml, Path, setuptools) and preserving proper import ordering and
formatting per project Python style.


# Define the source directory for the actual package (git-cloned repo)
src_dir = Path(__file__).parent.parent.parent / "nv-one-logger" / "nv_one_logger" / "one_logger_wandb"

if not src_dir.exists():
raise FileNotFoundError(f"{src_dir} not found.")

# Read the underlying pyproject.toml
pyproject_toml_path = src_dir / "pyproject.toml"
with pyproject_toml_path.open("r") as f:
pyproject_data = toml.load(f)

# Extract dependencies
# Handle poetry dependencies format
poetry_deps = pyproject_data.get("tool", {}).get("poetry", {}).get("dependencies", {})
install_requires = []
for pkg, ver in poetry_deps.items():
if pkg == "python":
continue
# Simple conversion, might need more robust handling for complex version strings
# but sufficient for this specific repo's needs
if isinstance(ver, str):
if ver.startswith("^"):
install_requires.append(f"{pkg}>={ver[1:]}")
else:
install_requires.append(f"{pkg}=={ver}")
elif isinstance(ver, dict):
# Handle cases like {version = "...", markers = "..."} if present
if "version" in ver:
version_spec = ver['version']
# If version already has operators (>=, ==, etc.), use as-is
if any(op in version_spec for op in ['>=', '<=', '==', '!=', '~=', '>', '<']):
install_requires.append(f"{pkg}{version_spec}")
else:
install_requires.append(f"{pkg}>={version_spec}")

# Extract version
version = pyproject_data.get("tool", {}).get("poetry", {}).get("version", "0.0.0")

# Map the package directory
# The package name in source is 'nv_one_logger' (from src directory in one_logger_wandb)
# one_logger_wandb/src/nv_one_logger
package_dir = {
"": str(src_dir / "src")
}
packages = setuptools.find_packages(where=str(src_dir / "src"))

setuptools.setup(
name="nv-one-logger-wandb",
version=version,
description="Extensions to onelogger library to use Weights and Biases as a backend.",
packages=packages,
package_dir=package_dir,
install_requires=install_requires,
)
4 changes: 4 additions & 0 deletions examples/configs/grpo_math_1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ logger:
swanlab:
project: "grpo-dev"
name: "grpo-dev-logger"
one_logger_enabled: false
one_logger:
project: "grpo-dev"
name: "grpo-dev-logger"
tensorboard: {}
mlflow:
experiment_name: "grpo-dev"
Expand Down
4 changes: 4 additions & 0 deletions examples/configs/sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ logger:
swanlab:
project: "sft-dev"
name: "sft-dev-${data.dataset_name}"
one_logger_enabled: false
one_logger:
project: "sft-dev"
name: "sft-dev-${data.dataset_name}"
tensorboard:
log_dir: "tb_logs-sft-dev-${data.dataset_name}"
mlflow:
Expand Down
Loading
Loading