NVIDIA / NVIDIA/cutlass

[BUG] `CUTE_DSL_KEEP=sass` is ignored in cutlass-dsl 4.6.0

Open Beginner friendly
#3,365 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

? - Needs Triage bug CuTe DSL inactive-30d
Dominant language
C++
Stars
10.5k
Forks
2.1k
Avg merge
3d 11h
Merged PRs (30d)
7

Description

Which component has the problem?

CuTe DSL

Bug Report

nvidia-cutlass-dsl==4.6.0 documents CUTE_DSL_KEEP=sass, and the deprecated CUTE_DSL_KEEP_SASS=1 warning recommends it, but the consolidated env var does not enable SASS dumping.

Minimal repro:

from __future__ import annotations

import os
import subprocess
import sys


CHECK = r"""
import importlib.metadata as metadata
import os
from cutlass.base_dsl.env_manager import EnvironmentVarManager, _parse_keep_tokens

m = EnvironmentVarManager("CUTE_DSL")
print("version:", metadata.version("nvidia-cutlass-dsl"))
print("CUTE_DSL_KEEP:", os.getenv("CUTE_DSL_KEEP"))
print("CUTE_DSL_KEEP_SASS:", os.getenv("CUTE_DSL_KEEP_SASS"))
print("parse('sass'):", sorted(_parse_keep_tokens("sass", "CUTE_DSL")))
print("keep_tokens:", sorted(m.keep_tokens))
print("keep_sass:", m.keep_sass)
"""


def check(label: str, env_update: dict[str, str]) -> bool:
    env = os.environ.copy()
    for key in ("CUTE_DSL_KEEP", "CUTE_DSL_KEEP_SASS"):
        env.pop(key, None)
    env.update(env_update)
    env["PYTHONWARNINGS"] = "ignore::DeprecationWarning"

    print(f"\n== {label} ==")
    output = subprocess.check_output([sys.executable, "-c", CHECK], env=env, text=True)
    print(output, end="")
    return "keep_sass: True" in output


documented_works = check("documented CUTE_DSL_KEEP=sass", {"CUTE_DSL_KEEP": "sass"})
deprecated_works = check("deprecated CUTE_DSL_KEEP_SASS=1", {"CUTE_DSL_KEEP_SASS": "1"})

if not documented_works and deprecated_works:
    print("\nBUG: CUTE_DSL_KEEP=sass is ignored, but CUTE_DSL_KEEP_SASS=1 works.")
    raise SystemExit(1)

Observed:

== documented CUTE_DSL_KEEP=sass ==
version: 4.6.0
CUTE_DSL_KEEP: sass
CUTE_DSL_KEEP_SASS: None
parse('sass'): []
keep_tokens: []
keep_sass: False

== deprecated CUTE_DSL_KEEP_SASS=1 ==
version: 4.6.0
CUTE_DSL_KEEP: None
CUTE_DSL_KEEP_SASS: 1
parse('sass'): []
keep_tokens: ['sass']
keep_sass: True

Expected: CUTE_DSL_KEEP=sass should set keep_tokens == ["sass"] and
keep_sass == True.

Likely fix: add "sass" to the accepted CUTE_DSL_KEEP token set used by
_parse_keep_tokens.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproduction and inspect _parse_keep_tokens and EnvironmentVarManager in cutlass.base_dsl.env_manager. Verify how documented CUTE_DSL_KEEP tokens are accepted, then run the reproduction with both environment-variable forms. Done means CUTE_DSL_KEEP=sass produces keep_tokens containing sass and keep_sass=True, while the deprecated form continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.