taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.05k stars 2.26k forks source link

[bug] Fix assign may lose precision warning & improve related logging #8553

Closed bobcao3 closed 1 week ago

bobcao3 commented 1 week ago

Does these few things:

  1. Removed printing of "No DebugInfo Available". This is simply a lot of spam when printing IR. Don't print when there's nothing to print
  2. Improve debug info handling for things that doesn't have source correlation, by first searching the immediate preceding statements for debug info (so the user at least know the ballpark), and when that fails prints the callable name & statement id
  3. Fixed the issue within snode_writer that emits Assign may lose precision: unknown <- f32 like crazy. (The unknown type is caused by a missing type_check on the indexing expression)
  4. Use our exception system to emit more helpful warnings for load-to-store forwarding, e.g.:
[W 06/23/24 19:08:39.945 11791278] TaichiWarning
File "/Users/bobcao3/taichi/python/taichi/lang/matrix_ops.py", line 281, in _matmul_helper:
                mat_z[i, j] = mat_z[i, j] + mat_x[i, k] * mat_y[k, j]
                                            ^^^^^^^^^^^
Loading variable 937 before anything is stored to it.
netlify[bot] commented 1 week ago

Deploy Preview for docsite-preview ready!

Name Link
Latest commit 8aff9d618669fd25e3d37577aa1de27e5c842100
Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6678e99e100aed0008776b9e
Deploy Preview https://deploy-preview-8553--docsite-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.