always MATMUL, test the ops in OPENCL
MODIFY
.github/workflows/test.yml
.github/workflows/test.yml
@@ -127,7 +127,9 @@ jobs:
python-version: 3.8
- name: Install Dependencies
run: pip install -e '.[gpu,testing]'
- - name: Run Pytest (default)
+ - name: Test OPENCL ops
+ run: OPT=2 OPENCL=1 python3 test/test_ops.py
+ - name: Test openpilot model
run: |
FLOAT16=1 UNSAFE_FLOAT4=1 DEBUGCL=1 python3 openpilot/compile.py
UNSAFE_FLOAT4=1 DEBUGCL=1 python3 openpilot/compile.py

MODIFY
accel/opencl/ops_opencl.py
accel/opencl/ops_opencl.py
@@ -227,8 +227,6 @@ class OpenCLBuffer(GPUBuffer):
#ewtypes.append(f"read_only image2d_t {name}_g")
return super().contiguous_view_constant_fold(name)
- # THIS WAS STUPIDLY OOMING THE WHOLE THING!
- #seen = set()
def _processing_op(ret, bufs: List[Tuple[str, OpenCLBuffer]]=[], code:str="acc", C=None, op=ReduceOps.SUM, reduce_shape=None, earlybufs:Set[str]=set(), earlycode:str="acc"):
if C is None or earlycode != "acc":
# TODO: handle an opencl conv without the conv part
@@ -239,10 +237,6 @@ class OpenCLBuffer(GPUBuffer):
w = [x for x in bufs if x[0] == "weight"][0][1]
ewbufs = [x for x in bufs if x[0] not in ["input", "weight"]]
- #if (x,w) in OpenCLBuffer.seen:
- # print("WARNING: recomputing CONV with", x, w)
- #OpenCLBuffer.seen.add((x,w))
-
# remove fakebufs
fakebufs, ewtypes, getters = get_getters(ewbufs, ret)
ewbufs = [x for x in ewbufs if x[0] not in fakebufs]
@@ -272,7 +266,7 @@ class OpenCLBuffer(GPUBuffer):
options.append("-DDEPTHWISE_UNSTRIDED")
elif C.cin == 1:
options.append("-DDEPTHWISE")
- if int(os.getenv("MATMUL", 0)) and C.groups == 1 and C.H == 1 and C.W == 1 and C.iy == 1 and C.ix == 1 and C.oy == 1 and C.ox == 1 and C.sx == 1 and C.sy == 1 and C.dx == 1 and C.dy == 1 and C.bs == 1:
+ if C.groups == 1 and C.H == 1 and C.W == 1 and C.iy == 1 and C.ix == 1 and C.oy == 1 and C.ox == 1 and C.sx == 1 and C.sy == 1 and C.dx == 1 and C.dy == 1 and C.bs == 1:
options.append("-DMATMUL")
# NOTE: this is not actually a matmul, it's a vector * matrix

always MATMUL, test the ops in OPENCL