Make Python interface work for non-SM80 targets (#726)
* Make Python interface work for non-SM80 targets * Remove line in README
This commit is contained in:
@@ -41,7 +41,7 @@ import sys
|
||||
import cutlass
|
||||
import pycutlass
|
||||
from pycutlass import *
|
||||
import util
|
||||
from pycutlass.utils.device import device_cc
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -62,7 +62,7 @@ except:
|
||||
sys.exit(0)
|
||||
|
||||
# Check that the device is of a sufficient compute capability
|
||||
cc = util.get_device_cc()
|
||||
cc = device_cc()
|
||||
assert cc >= 70, "The CUTLASS Python Conv2d example requires compute capability greater than or equal to 70."
|
||||
|
||||
alignment = 1
|
||||
@@ -82,8 +82,17 @@ C = TensorDescription(cutlass.float32, cutlass.TensorNHWC, alignment)
|
||||
element_acc = cutlass.float32
|
||||
element_epilogue = cutlass.float32
|
||||
|
||||
# Select instruction shape based on the Tensor Core instructions supported
|
||||
# by the device on which we are running
|
||||
if cc == 70:
|
||||
instruction_shape = [8, 8, 4]
|
||||
elif cc == 75:
|
||||
instruction_shape = [16, 8, 8]
|
||||
else:
|
||||
instruction_shape = [16, 8, 16]
|
||||
|
||||
math_inst = MathInstruction(
|
||||
[16, 8, 8], # Shape of the Tensor Core instruction
|
||||
instruction_shape,
|
||||
A.element, B.element, element_acc,
|
||||
cutlass.OpClass.TensorOp,
|
||||
MathOperation.multiply_add
|
||||
|
||||
Reference in New Issue
Block a user