You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "LeiWang1999 (via GitHub)" <gi...@apache.org> on 2025/09/16 10:01:55 UTC
[PR] [TIR][CUDA] Enhance Precision CUDA Codegen [tvm]
LeiWang1999 opened a new pull request, #18320:
URL: https://github.com/apache/tvm/pull/18320
Previously, `float` constants in codegen were always emitted in **scientific decimal format**, e.g.:
```cpp
bfloat16_t(3.487723e-05f);
```
This could introduce slight **rounding differences** compared to the actual binary representation, since the constant is printed and then re-parsed in decimal. we now emit the value in **hexadecimal floating-point format** (`std::hexfloat`) to preserve the exact binary value, and additionally include the decimal form as a comment for readability:
```cpp
bfloat16_t(0x1.2492492492492p-15f /*3.487723e-05*/)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [TIR][CUDA] Preserve float precision in codegen with hexfloat output [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #18320:
URL: https://github.com/apache/tvm/pull/18320#issuecomment-3298357997
need to update the testcase and we are good to go
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [TIR][CUDA] Preserve float precision in codegen with hexfloat output [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #18320:
URL: https://github.com/apache/tvm/pull/18320
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [TIR][CUDA] Preserve float precision in codegen with hexfloat output [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #18320:
URL: https://github.com/apache/tvm/pull/18320#issuecomment-3307180567
i meant that we should fix https://ci.tlcpack.ai/blue/organizations/jenkins/tvm-gpu/detail/PR-18320/2/pipeline which likely is caused by expected code in the original form
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [TIR][CUDA] Preserve float precision in codegen with hexfloat output [tvm]
Posted by "LeiWang1999 (via GitHub)" <gi...@apache.org>.
LeiWang1999 commented on PR #18320:
URL: https://github.com/apache/tvm/pull/18320#issuecomment-3306199621
> need to update the testcase and we are good to go
added a test case at `tests/python/codegen/test_target_codegen_cuda.py`: https://github.com/apache/tvm/pull/18320/files#diff-de74af0a4254367528294a58410a1c2488d014d3fafdbd8446f88b621358ad4dR804-R820
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org