Closed xanderdunn closed 1 year ago
Code is unreachable
This error message is reported by Pyright, have no idea what happened, but Pyright reports the following code is unreadable, coc marked them, we can do nothing in coc/coc-pyright side. Properly an issue of Pyright.
Thanks, microsoft/pyright#4640
Versions
coc-pyright 1.1.293 with Pyright 1.1.293
showOutput Pyright:
To reproduce the issue, install the
pytorch
andtriton
packages. I find that this issue does not reproduce if triton is not installed:Now open the file
fused_gelu.py
from here.This is the syntax highlighting I see:
The bottom half of the function
gelu_partial_layer_fused_forward
is erroneously marked as unreachable code. It is 100% definitely incorrect because you can actually run it yourself and see that the code is executed. This happens to several of the functions in this file, including thePartialGeluLayer.bakcward
static method that is not jit compiled.It's bad enough that I've had to disable Coc to be able to work with this file. It would be interesting to understand why this is happening here and if it can be fixed. If not, is there a way I could disable the unreachable code warnings and syntax highlighting for this file specifically?