NVIDIA / NVIDIA/tilus

[Feature] Make all primitive data types and pointer data types real class

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
492
Forks
30
Avg merge
4d 9h
Merged PRs (30d)
2

Description

In Tilus and Hidet, we use the following way to define data types:

class IntegerType(DataType):
    ...

int32 = IntegerType(...)

We use types like int32 as the type hint in the DSL:

class MyKernel(tilus.Script):
    def __call__(self, a: int32):
        ...

IDEs like PyCharm and VSCode will report warning like

Type hint is invalid or refers to the expression which is not a correct type

We need to change the way of defining data types to avoid such warning.

Workaround: to temporarily disable the warning, we can configure the IDE settings.

  • For PyCharm:
    Settings -> Editor -> Inspections -> Python -> Security -> Unmark "Invalid type hints usage and definitions".

Contributor guide

Open the contributing guide

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 by tracing how Tilus and Hidet define primitive and pointer data types, then follow their use as annotations in the DSL. Done means these types are represented as real classes so PyCharm and VSCode no longer report invalid type-hint warnings, while the existing DSL behavior remains intact.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.