Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH, MAINT: workunit quirks to fix #161

Open
tylerjereddy opened this issue Jan 18, 2023 · 0 comments
Open

ENH, MAINT: workunit quirks to fix #161

tylerjereddy opened this issue Jan 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tylerjereddy
Copy link
Contributor

When working on more complex workunits, changing from one fundamental type to another is not supported, which is surprising:

--- a/pykokkos/lib/ufunc_workunits.py
+++ b/pykokkos/lib/ufunc_workunits.py
@@ -28,7 +28,7 @@ def floor_divide_impl_1d_int32(tid: int, viewA: pk.View1D[pk.int32], viewB: pk.V
 
 @pk.workunit
 def floor_divide_impl_1d_int64(tid: int, viewA: pk.View1D[pk.int64], viewB: pk.View1D[pk.int64], out: pk.View1D[pk.int64]):
-    mod: float = 0
+    mod: double = 0
     div: int = 0
     floordiv: int = 0
Error on line 31 : Type not supported
DEBUG AST:
AnnAssign(
    target=Name(id='mod', ctx=Store()),
    annotation=Name(id='double', ctx=Load()),
    value=Constant(value=0),
    simple=1)
    mod: double = 0
    ^^^^^^^^^^^^^^^

The error message when declaring but not initializing also leaves the developer a bit confused perhaps:

--- a/pykokkos/lib/ufunc_workunits.py
+++ b/pykokkos/lib/ufunc_workunits.py
@@ -28,7 +28,7 @@ def floor_divide_impl_1d_int32(tid: int, viewA: pk.View1D[pk.int32], viewB: pk.V
 
 @pk.workunit
 def floor_divide_impl_1d_int64(tid: int, viewA: pk.View1D[pk.int64], viewB: pk.View1D[pk.int64], out: pk.View1D[pk.int64]):
-    mod: float = 0
+    mod: float
     div: int = 0
     floordiv: int = 0

Translation of <ast.FunctionDef object at 0x7fe819856d40> failed

Finally, some errors go stdout instead of stderr, which is pretty confusing:

E               hypothesis.errors.Flaky: Inconsistent test results! Test case was Conclusion(status=Status.INTERESTING, interesting_origin=(<class 'SystemExit'>, '/home/tyler/github_projects/pykokkos/pykokkos/core/translators/static.py', 140, (), ())) on first run but Conclusion(status=Status.INTERESTING, interesting_origin=(<class 'ImportError'>, '<frozen importlib._bootstrap>', 241, (), ())) on second

../../python_310_pykokkos_work/lib/python3.10/site-packages/hypothesis/internal/conjecture/datatree.py:406: Flaky
--------------------------------------------------------------------------------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------------------------------------------------------------------------------
desired_workunit: <function floor_divide_impl_1d_int64 at 0x7f9b795eb2e0>
File "/home/tyler/github_projects/pykokkos/pykokkos/lib/ufunc_workunits.py", line 48:
 undefined symbol isgreater used

It looks like this comes down to pretty_print() literally using print() in pykokkos/core/visitors/visitors_util.py .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant