Airplaneless / Hallgerd

Deep learning framework for OpenCL
MIT License
6 stars 0 forks source link

Error when running mlp_mnist.py #3

Open tetrahydra opened 4 years ago

tetrahydra commented 4 years ago

Hello, I am trying your example and getting this error. How can I fix this?

(pyenv) halim@Halims-MacBook-Pro Hallgerd % python3 mlp_mnist.py 
Found devices:
    Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Intel(R) UHD Graphics 630
    AMD Radeon Pro 560X Compute Engine

Using  Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  0%|                                                                                | 0/20 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "mlp_mnist.py", line 44, in <module>
    model.fit(dataX, dataY)
  File "/Users/halim/Hallgerd/hallgerd/core.py", line 61, in fit
    _ = self.__call__(x.T)
  File "/Users/halim/Hallgerd/hallgerd/core.py", line 31, in __call__
    xa = layer(xa)
  File "/Users/halim/Hallgerd/hallgerd/layers.py", line 35, in __call__
    y = (x @ self.weight.transpose()) % self.bias
  File "/Users/halim/Hallgerd/gunnar/core.py", line 135, in transpose
    event = self.device.prg.transpose(self.device.queue, global_sizes, local_sizes, N, M, self.buffer, res.buffer)
  File "/Users/halim/.virtualenvs/pyenv/lib/python3.8/site-packages/pyopencl/__init__.py", line 864, in kernel_call
    return self._enqueue(self, queue, global_size, local_size, *args, **kwargs)
  File "<generated code>", line 78, in enqueue_knl_transpose
pyopencl._cl.LogicError: clEnqueueNDRangeKernel failed: INVALID_WORK_ITEM_SIZE
tetrahydra commented 4 years ago

I solved this by changing the code in mlp_mnist.py. However, I have to remove

TS=32, TSK=32, WPTM=4, WPTN=4, TSM=128, TSN=128

print('Found devices:\n\t{}'.format('\n\t'.join(dnames)))
    print('\nUsing ', dnames[2])
    # gpu = Device([devices[dnames[2]]], DTYPE=np.float32, TS=32, TSK=32, WPTM=4, WPTN=4, TSM=128, TSN=128)
    gpu = Device([devices[dnames[2]]], DTYPE=np.float32)