From 5b786aaad1bb905e8393e96f8a597bc193ee2741 Mon Sep 17 00:00:00 2001 From: Jongsok Choi Date: Sun, 23 Nov 2025 13:10:47 -0800 Subject: [PATCH 1/4] Fix CI depedency error for nvidia-nvshmem-cu12 when using PyTorch nightly. lint: https://github.com/pytorch/helion/actions/runs/19614785063/job/56171056371?pr=1162 test:https://github.com/pytorch/helion/actions/runs/19614785070/job/56166472979?pr=1162 --- .github/workflows/lint.yml | 4 ++++ .github/workflows/test.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0cb162cb3..d24801138 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,6 +35,10 @@ jobs: - name: Install PyTorch run: | source .venv/bin/activate + if [[ "${{ matrix.runtime-version }}" == "cu128" ]]; then + # Install nvidia-nvshmem-cu12 dependency from cu129 index (missing on cu128) + uv pip install -U --pre nvidia-nvshmem-cu12 --index-url https://download.pytorch.org/whl/nightly/cu129 + fi uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128 - name: Install lint dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b51f21669..29e521bab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -113,6 +113,10 @@ jobs: uv pip install -U "torch==2.9.*" --index-url https://download.pytorch.org/whl/${{ matrix.runtime-version }} else # Default to nightly + if [[ "${{ matrix.runtime-version }}" == "cu128" ]]; then + # Install nvidia-nvshmem-cu12 dependency from cu129 index (missing on cu128) + uv pip install -U --pre nvidia-nvshmem-cu12 --index-url https://download.pytorch.org/whl/nightly/cu129 + fi uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/${{ matrix.runtime-version }} fi From b82014ed9d93e30cb747435b1691018cd77941fd Mon Sep 17 00:00:00 2001 From: Jongsok Choi Date: Sun, 23 Nov 2025 13:19:12 -0800 Subject: [PATCH 2/4] Remove conditional for cu128. --- .github/workflows/lint.yml | 6 ++---- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d24801138..f41e186da 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,10 +35,8 @@ jobs: - name: Install PyTorch run: | source .venv/bin/activate - if [[ "${{ matrix.runtime-version }}" == "cu128" ]]; then - # Install nvidia-nvshmem-cu12 dependency from cu129 index (missing on cu128) - uv pip install -U --pre nvidia-nvshmem-cu12 --index-url https://download.pytorch.org/whl/nightly/cu129 - fi + # Install nvidia-nvshmem-cu12 from cu129 index (missing on cu128) + uv pip install -U --pre nvidia-nvshmem-cu12 --index-url https://download.pytorch.org/whl/nightly/cu129 uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128 - name: Install lint dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29e521bab..d8d8eada4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,7 +114,7 @@ jobs: else # Default to nightly if [[ "${{ matrix.runtime-version }}" == "cu128" ]]; then - # Install nvidia-nvshmem-cu12 dependency from cu129 index (missing on cu128) + # Install nvidia-nvshmem-cu12 from cu129 index (missing on cu128) uv pip install -U --pre nvidia-nvshmem-cu12 --index-url https://download.pytorch.org/whl/nightly/cu129 fi uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/${{ matrix.runtime-version }} From 1c2a735ce4a61f2b2aebc3752423b846dd3eb0c3 Mon Sep 17 00:00:00 2001 From: Jongsok Choi Date: Sat, 22 Nov 2025 00:55:25 -0800 Subject: [PATCH 3/4] Lint fix --- helion/_logging/_internal.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/helion/_logging/_internal.py b/helion/_logging/_internal.py index 23354cdb7..7dd5d2b40 100644 --- a/helion/_logging/_internal.py +++ b/helion/_logging/_internal.py @@ -2,9 +2,11 @@ from dataclasses import dataclass from dataclasses import field +import functools import logging import os from typing import Callable +from typing import Generic from typing import ParamSpec LOG_ENV_VAR = "HELION_LOGS" @@ -82,14 +84,11 @@ def init_logs() -> None: P = ParamSpec("P") -class LazyString: +class LazyString(Generic[P]): def __init__( self, func: Callable[P, str], *args: P.args, **kwargs: P.kwargs ) -> None: - # pyrefly: ignore [invalid-type-var] - self.func: Callable[P, str] = func - self.args: tuple[object, ...] = args - self.kwargs: object = kwargs + self._callable: Callable[[], str] = functools.partial(func, *args, **kwargs) def __str__(self) -> str: - return self.func(*self.args, **self.kwargs) + return self._callable() From 64888db2fc45cd2561c0dc2a0decb046c36506c1 Mon Sep 17 00:00:00 2001 From: Jongsok Choi Date: Sun, 23 Nov 2025 13:33:02 -0800 Subject: [PATCH 4/4] Fix pyrefly return type errors in benchmarks/run.py --- benchmarks/run.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmarks/run.py b/benchmarks/run.py index 8575703d5..5c4eab490 100644 --- a/benchmarks/run.py +++ b/benchmarks/run.py @@ -741,7 +741,7 @@ def load_kernel_config( def process_single_kernel_mapping( kernel_name: str, mapping: dict[str, Any] -) -> tuple[str, ...]: +) -> tuple[Any, ...]: """Process a single kernel mapping configuration.""" if not isinstance(mapping, dict): raise ValueError( @@ -785,11 +785,11 @@ def process_single_kernel_mapping( def merge_kernel_configs( - base_mappings: dict[str, tuple[str, ...]], + base_mappings: dict[str, tuple[Any, ...]], base_metrics: dict[str, dict[str, str]], - custom_mappings: dict[str, tuple[str, ...]], + custom_mappings: dict[str, tuple[Any, ...]], custom_metrics: dict[str, dict[str, str]], -) -> tuple[dict[str, tuple[str, ...]], dict[str, dict[str, str]]]: +) -> tuple[dict[str, tuple[Any, ...]], dict[str, dict[str, str]]]: """Merge custom kernel configurations with base configurations. Custom configs extend and can override base configs.