Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Sep 14, 2025

No description provided.

Copy link
Contributor

@cyx-6 cyx-6 left a comment

Choose a reason for hiding this comment

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

Happy to merge the first PR:)

@cyx-6 cyx-6 merged commit 0e954b3 into apache:dev Sep 14, 2025
3 checks passed
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
tqchen added a commit to tqchen/tvm-ffi that referenced this pull request Oct 13, 2025
This PR introduces a new C API TVMFFIErrorSetRaisedFromCStrParts.

Background: when DSL compilers report errors, sometimes there are common
parts that appears multiple times, such as function signature.

For example, the following are possible error messages from a DSL.

- Argument apache#1 mismatch in `matmul(x: Tensor, y: Tensor)`, dtype mismatch
- Argument apache#2 mismatch in `matmul(x: Tensor, y: Tensor)`, shape[0] mismatch

While we can store each message as const string and pass them
to `TVMFFIErrorSetRaisedFromCStr`. There are quite a bit of duplication here.

This API allows us to store the error messages in parts, so parts
like "mismatch in `matmul(x: Tensor, y: Tensor)`,"  get reused across
multiple error messages. Because DSLs usually have minimal runtime, having
a minimal helper C API would simplify the possible overhead of compiler
construction side.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants