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

Exception after DAG optimization #38

Closed
tomwhite opened this issue Jul 7, 2022 · 0 comments · Fixed by #64
Closed

Exception after DAG optimization #38

tomwhite opened this issue Jul 7, 2022 · 0 comments · Fixed by #64
Labels
bug Something isn't working

Comments

@tomwhite
Copy link
Member

tomwhite commented Jul 7, 2022

>>> import cubed.array_api as xp
>>> a = xp.ones((2, 2), chunks=(2, 2))
>>> b = xp.positive(a)
>>> c = xp.asarray(b)
>>> d = xp.equal(b, c)
>>> d.compute()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tom/projects-workspace/barry/cubed/core/array.py", line 77, in compute
    self.plan.execute(
  File "/Users/tom/projects-workspace/barry/cubed/core/plan.py", line 188, in execute
    executor.execute_plan(plan, **kwargs)
  File "/Users/tom/opt/miniconda3/envs/barry/lib/python3.8/site-packages/rechunker/executors/python.py", line 29, in execute_plan
    plan()
  File "/Users/tom/opt/miniconda3/envs/barry/lib/python3.8/site-packages/rechunker/executors/python.py", line 22, in plan
    stage.function(m, config=pipeline.config)
  File "/Users/tom/projects-workspace/barry/cubed/primitive/blockwise.py", line 36, in apply_blockwise
    config.write.array[out_chunk_key] = config.function(*args)
  File "/Users/tom/projects-workspace/barry/cubed/primitive/blockwise.py", line 230, in fused_func
    return pipeline2.config.function(pipeline1.config.function(*args))
TypeError: equal() takes from 2 to 3 positional arguments but 1 were given
>>> d.compute(optimize_graph=False)
array([[ True,  True],
       [ True,  True]])

What is happening is that asarray returns b, and then b and d are fused, which causes a problem with the number of arguments.

This is similar to test_no_fusion. Found as array_api_tests/test_creation_functions.py::test_asarray_arrays failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant