NVIDIA / NVIDIA/cutlass

[QST][Cute-DSL] How to return more than 1 value from llvm.inline_asm

Open
#2,560 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm using llvm.inline_asm in cute-dsl and currently it can only return 1 value, like this:

@dsl_user_op
def rsqrt(a: float | Float32, *, loc=None, ip=None) -> Float32:
    return Float32(
        llvm.inline_asm(
            T.f32(),
            [Float32(a).ir_value(loc=loc, ip=ip)],
            "rsqrt.approx.ftz.f32 $0, $1;",
            "=f,f",
            has_side_effects=False,
            is_align_stack=False,
            asm_dialect=llvm.AsmDialect.AD_ATT,
        )
    )

I'm looking for ways to return more than 1 value. I've tried using T.vector(2, T.f32()) as the output type and "=f,=f,f" as the constraint but that didn't work.

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 llvm.inline_asm call and the rsqrt example in the issue, then trace how Cute-DSL represents its output type and constraints. No implementation files or tests are named, so first identify the relevant inline-assembly entry point and existing tests. Done would require a confirmed, tested way to represent more than one returned value, or a clearly scoped implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.