warp-lang 0.10.1__py3-none-win_amd64.whl → 0.11.0__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of warp-lang might be problematic. Click here for more details.
- warp/__init__.py +10 -4
- warp/__init__.pyi +1 -0
- warp/bin/warp-clang.dll +0 -0
- warp/bin/warp.dll +0 -0
- warp/build.py +5 -3
- warp/build_dll.py +29 -9
- warp/builtins.py +868 -507
- warp/codegen.py +1074 -638
- warp/config.py +3 -3
- warp/constants.py +6 -0
- warp/context.py +715 -222
- warp/fabric.py +326 -0
- warp/fem/__init__.py +27 -0
- warp/fem/cache.py +389 -0
- warp/fem/dirichlet.py +181 -0
- warp/fem/domain.py +263 -0
- warp/fem/field/__init__.py +101 -0
- warp/fem/field/field.py +149 -0
- warp/fem/field/nodal_field.py +299 -0
- warp/fem/field/restriction.py +21 -0
- warp/fem/field/test.py +181 -0
- warp/fem/field/trial.py +183 -0
- warp/fem/geometry/__init__.py +19 -0
- warp/fem/geometry/closest_point.py +70 -0
- warp/fem/geometry/deformed_geometry.py +271 -0
- warp/fem/geometry/element.py +744 -0
- warp/fem/geometry/geometry.py +186 -0
- warp/fem/geometry/grid_2d.py +373 -0
- warp/fem/geometry/grid_3d.py +435 -0
- warp/fem/geometry/hexmesh.py +953 -0
- warp/fem/geometry/partition.py +376 -0
- warp/fem/geometry/quadmesh_2d.py +532 -0
- warp/fem/geometry/tetmesh.py +840 -0
- warp/fem/geometry/trimesh_2d.py +577 -0
- warp/fem/integrate.py +1616 -0
- warp/fem/operator.py +191 -0
- warp/fem/polynomial.py +213 -0
- warp/fem/quadrature/__init__.py +2 -0
- warp/fem/quadrature/pic_quadrature.py +245 -0
- warp/fem/quadrature/quadrature.py +294 -0
- warp/fem/space/__init__.py +292 -0
- warp/fem/space/basis_space.py +489 -0
- warp/fem/space/collocated_function_space.py +105 -0
- warp/fem/space/dof_mapper.py +236 -0
- warp/fem/space/function_space.py +145 -0
- warp/fem/space/grid_2d_function_space.py +267 -0
- warp/fem/space/grid_3d_function_space.py +306 -0
- warp/fem/space/hexmesh_function_space.py +352 -0
- warp/fem/space/partition.py +350 -0
- warp/fem/space/quadmesh_2d_function_space.py +369 -0
- warp/fem/space/restriction.py +160 -0
- warp/fem/space/shape/__init__.py +15 -0
- warp/fem/space/shape/cube_shape_function.py +738 -0
- warp/fem/space/shape/shape_function.py +103 -0
- warp/fem/space/shape/square_shape_function.py +611 -0
- warp/fem/space/shape/tet_shape_function.py +567 -0
- warp/fem/space/shape/triangle_shape_function.py +429 -0
- warp/fem/space/tetmesh_function_space.py +292 -0
- warp/fem/space/topology.py +295 -0
- warp/fem/space/trimesh_2d_function_space.py +221 -0
- warp/fem/types.py +77 -0
- warp/fem/utils.py +495 -0
- warp/native/array.h +147 -44
- warp/native/builtin.h +122 -149
- warp/native/bvh.cpp +73 -325
- warp/native/bvh.cu +406 -23
- warp/native/bvh.h +34 -43
- warp/native/clang/clang.cpp +13 -8
- warp/native/crt.h +2 -0
- warp/native/cuda_crt.h +5 -0
- warp/native/cuda_util.cpp +15 -3
- warp/native/cuda_util.h +3 -1
- warp/native/cutlass/tools/library/scripts/conv2d_operation.py +463 -0
- warp/native/cutlass/tools/library/scripts/conv3d_operation.py +321 -0
- warp/native/cutlass/tools/library/scripts/gemm_operation.py +988 -0
- warp/native/cutlass/tools/library/scripts/generator.py +4625 -0
- warp/native/cutlass/tools/library/scripts/library.py +799 -0
- warp/native/cutlass/tools/library/scripts/manifest.py +402 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/docs/source/conf.py +96 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/profile/conv/conv2d_f16_sm80.py +106 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/profile/gemm/gemm_f32_sm80.py +91 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/setup.py +80 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/__init__.py +48 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/arguments.py +118 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/c_types.py +241 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/compiler.py +432 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/conv2d_operation.py +631 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/epilogue.py +1026 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/frontend.py +104 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/gemm_operation.py +1276 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/library.py +744 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/memory_manager.py +74 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/operation.py +110 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/parser.py +619 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/reduction_operation.py +398 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/tensor_ref.py +70 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/test/__init__.py +4 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/test/conv2d_testbed.py +646 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/test/gemm_grouped_testbed.py +235 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/test/gemm_testbed.py +557 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/test/profiler.py +70 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/type_hint.py +39 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/utils/__init__.py +1 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/utils/device.py +76 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/src/pycutlass/utils/reference_model.py +255 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/__init__.py +0 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_dgrad_implicit_gemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_sm80.py +201 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_dgrad_implicit_gemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32_sm80.py +177 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_dgrad_implicit_gemm_f32nhwc_f32nhwc_f32nhwc_simt_f32_sm80.py +98 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_dgrad_implicit_gemm_tf32nhwc_tf32nhwc_f32nhwc_tensor_op_f32_sm80.py +95 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_few_channels_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_sm80.py +163 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_fixed_channels_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_sm80.py +187 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_implicit_gemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_sm80.py +309 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_implicit_gemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32_sm80.py +54 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_implicit_gemm_f32nhwc_f32nhwc_f32nhwc_simt_f32_sm80.py +96 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_fprop_implicit_gemm_tf32nhwc_tf32nhwc_f32nhwc_tensor_op_f32_sm80.py +107 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_strided_dgrad_implicit_gemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32_sm80.py +253 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_wgrad_implicit_gemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_sm80.py +97 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_wgrad_implicit_gemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32_sm80.py +242 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_wgrad_implicit_gemm_f32nhwc_f32nhwc_f32nhwc_simt_f32_sm80.py +96 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/conv2d_wgrad_implicit_gemm_tf32nhwc_tf32nhwc_f32nhwc_tensor_op_f32_sm80.py +107 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/conv/run_all_tests.py +10 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/frontend/test_frontend.py +146 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/__init__.py +0 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_bf16_sm80.py +96 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_f16_sm80.py +447 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_f32_sm80.py +146 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_f64_sm80.py +102 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_grouped_sm80.py +203 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/gemm_s8_sm80.py +229 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/gemm/run_all_tests.py +9 -0
- warp/native/cutlass/tools/library/scripts/pycutlass/test/unit/test_sm80.py +453 -0
- warp/native/cutlass/tools/library/scripts/rank_2k_operation.py +398 -0
- warp/native/cutlass/tools/library/scripts/rank_k_operation.py +387 -0
- warp/native/cutlass/tools/library/scripts/rt.py +796 -0
- warp/native/cutlass/tools/library/scripts/symm_operation.py +400 -0
- warp/native/cutlass/tools/library/scripts/trmm_operation.py +407 -0
- warp/native/cutlass_gemm.cu +5 -3
- warp/native/exports.h +1240 -952
- warp/native/fabric.h +228 -0
- warp/native/hashgrid.cpp +4 -4
- warp/native/hashgrid.h +22 -2
- warp/native/intersect.h +22 -7
- warp/native/intersect_adj.h +8 -8
- warp/native/intersect_tri.h +1 -1
- warp/native/marching.cu +157 -161
- warp/native/mat.h +80 -19
- warp/native/matnn.h +2 -2
- warp/native/mesh.cpp +33 -108
- warp/native/mesh.cu +114 -23
- warp/native/mesh.h +446 -46
- warp/native/noise.h +272 -329
- warp/native/quat.h +51 -8
- warp/native/rand.h +45 -35
- warp/native/range.h +6 -2
- warp/native/reduce.cpp +1 -1
- warp/native/reduce.cu +10 -12
- warp/native/runlength_encode.cu +6 -10
- warp/native/scan.cu +8 -11
- warp/native/sparse.cpp +4 -4
- warp/native/sparse.cu +164 -154
- warp/native/spatial.h +2 -2
- warp/native/temp_buffer.h +14 -30
- warp/native/vec.h +107 -23
- warp/native/volume.h +120 -0
- warp/native/warp.cpp +560 -30
- warp/native/warp.cu +431 -44
- warp/native/warp.h +13 -4
- warp/optim/__init__.py +1 -0
- warp/optim/linear.py +922 -0
- warp/optim/sgd.py +92 -0
- warp/render/render_opengl.py +335 -119
- warp/render/render_usd.py +11 -11
- warp/sim/__init__.py +2 -2
- warp/sim/articulation.py +385 -185
- warp/sim/collide.py +8 -0
- warp/sim/import_mjcf.py +297 -106
- warp/sim/import_urdf.py +389 -210
- warp/sim/import_usd.py +198 -97
- warp/sim/inertia.py +17 -18
- warp/sim/integrator_euler.py +14 -8
- warp/sim/integrator_xpbd.py +158 -16
- warp/sim/model.py +795 -291
- warp/sim/render.py +3 -3
- warp/sim/utils.py +3 -0
- warp/sparse.py +640 -150
- warp/stubs.py +606 -267
- warp/tape.py +61 -10
- warp/tests/__main__.py +3 -6
- warp/tests/assets/curlnoise_golden.npy +0 -0
- warp/tests/assets/pnoise_golden.npy +0 -0
- warp/tests/{test_class_kernel.py → aux_test_class_kernel.py} +9 -1
- warp/tests/aux_test_conditional_unequal_types_kernels.py +21 -0
- warp/tests/{test_dependent.py → aux_test_dependent.py} +2 -2
- warp/tests/{test_reference.py → aux_test_reference.py} +1 -1
- warp/tests/aux_test_unresolved_func.py +14 -0
- warp/tests/aux_test_unresolved_symbol.py +14 -0
- warp/tests/disabled_kinematics.py +239 -0
- warp/tests/run_coverage_serial.py +31 -0
- warp/tests/test_adam.py +103 -106
- warp/tests/test_arithmetic.py +128 -74
- warp/tests/test_array.py +212 -97
- warp/tests/test_array_reduce.py +57 -23
- warp/tests/test_atomic.py +64 -28
- warp/tests/test_bool.py +99 -0
- warp/tests/test_builtins_resolution.py +1292 -0
- warp/tests/test_bvh.py +42 -18
- warp/tests/test_closest_point_edge_edge.py +54 -57
- warp/tests/test_codegen.py +208 -130
- warp/tests/test_compile_consts.py +28 -20
- warp/tests/test_conditional.py +108 -24
- warp/tests/test_copy.py +10 -12
- warp/tests/test_ctypes.py +112 -88
- warp/tests/test_dense.py +21 -14
- warp/tests/test_devices.py +98 -0
- warp/tests/test_dlpack.py +75 -75
- warp/tests/test_examples.py +277 -0
- warp/tests/test_fabricarray.py +955 -0
- warp/tests/test_fast_math.py +15 -11
- warp/tests/test_fem.py +1271 -0
- warp/tests/test_fp16.py +53 -19
- warp/tests/test_func.py +187 -86
- warp/tests/test_generics.py +194 -49
- warp/tests/test_grad.py +178 -109
- warp/tests/test_grad_customs.py +176 -0
- warp/tests/test_hash_grid.py +52 -37
- warp/tests/test_import.py +10 -23
- warp/tests/test_indexedarray.py +32 -31
- warp/tests/test_intersect.py +18 -9
- warp/tests/test_large.py +141 -0
- warp/tests/test_launch.py +14 -41
- warp/tests/test_lerp.py +64 -65
- warp/tests/test_linear_solvers.py +154 -0
- warp/tests/test_lvalue.py +493 -0
- warp/tests/test_marching_cubes.py +12 -13
- warp/tests/test_mat.py +517 -2898
- warp/tests/test_mat_lite.py +115 -0
- warp/tests/test_mat_scalar_ops.py +2889 -0
- warp/tests/test_math.py +103 -9
- warp/tests/test_matmul.py +305 -69
- warp/tests/test_matmul_lite.py +410 -0
- warp/tests/test_mesh.py +71 -14
- warp/tests/test_mesh_query_aabb.py +41 -25
- warp/tests/test_mesh_query_point.py +140 -22
- warp/tests/test_mesh_query_ray.py +39 -22
- warp/tests/test_mlp.py +30 -22
- warp/tests/test_model.py +92 -89
- warp/tests/test_modules_lite.py +39 -0
- warp/tests/test_multigpu.py +88 -114
- warp/tests/test_noise.py +12 -11
- warp/tests/test_operators.py +16 -20
- warp/tests/test_options.py +11 -11
- warp/tests/test_pinned.py +17 -18
- warp/tests/test_print.py +32 -11
- warp/tests/test_quat.py +275 -129
- warp/tests/test_rand.py +18 -16
- warp/tests/test_reload.py +38 -34
- warp/tests/test_rounding.py +50 -43
- warp/tests/test_runlength_encode.py +168 -20
- warp/tests/test_smoothstep.py +9 -11
- warp/tests/test_snippet.py +143 -0
- warp/tests/test_sparse.py +261 -63
- warp/tests/test_spatial.py +276 -243
- warp/tests/test_streams.py +110 -85
- warp/tests/test_struct.py +268 -63
- warp/tests/test_tape.py +39 -21
- warp/tests/test_torch.py +118 -89
- warp/tests/test_transient_module.py +12 -13
- warp/tests/test_types.py +614 -0
- warp/tests/test_utils.py +494 -0
- warp/tests/test_vec.py +354 -2050
- warp/tests/test_vec_lite.py +73 -0
- warp/tests/test_vec_scalar_ops.py +2099 -0
- warp/tests/test_volume.py +457 -293
- warp/tests/test_volume_write.py +124 -134
- warp/tests/unittest_serial.py +35 -0
- warp/tests/unittest_suites.py +341 -0
- warp/tests/unittest_utils.py +568 -0
- warp/tests/unused_test_misc.py +71 -0
- warp/tests/{test_debug.py → walkthough_debug.py} +3 -17
- warp/thirdparty/appdirs.py +36 -45
- warp/thirdparty/unittest_parallel.py +549 -0
- warp/torch.py +9 -6
- warp/types.py +1089 -366
- warp/utils.py +93 -387
- warp_lang-0.11.0.dist-info/METADATA +238 -0
- warp_lang-0.11.0.dist-info/RECORD +332 -0
- {warp_lang-0.10.1.dist-info → warp_lang-0.11.0.dist-info}/WHEEL +1 -1
- warp/tests/test_all.py +0 -219
- warp/tests/test_array_scan.py +0 -60
- warp/tests/test_base.py +0 -208
- warp/tests/test_unresolved_func.py +0 -7
- warp/tests/test_unresolved_symbol.py +0 -7
- warp_lang-0.10.1.dist-info/METADATA +0 -21
- warp_lang-0.10.1.dist-info/RECORD +0 -188
- /warp/tests/{test_compile_consts_dummy.py → aux_test_compile_consts_dummy.py} +0 -0
- /warp/tests/{test_reference_reference.py → aux_test_reference_reference.py} +0 -0
- /warp/tests/{test_square.py → aux_test_square.py} +0 -0
- {warp_lang-0.10.1.dist-info → warp_lang-0.11.0.dist-info}/LICENSE.md +0 -0
- {warp_lang-0.10.1.dist-info → warp_lang-0.11.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# test/unit/conv/device/conv2d_fprop_fixed_channels_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_sm80.cu
|
|
2
|
+
import pycutlass
|
|
3
|
+
from pycutlass.test import *
|
|
4
|
+
from pycutlass.utils.device import device_cc
|
|
5
|
+
import unittest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@unittest.skipIf(device_cc() < 80, "Device compute capability is insufficient for SM80 tests.")
|
|
9
|
+
def conv2d_fixed_channel_problemsizes(channels):
|
|
10
|
+
problem_sizes = [
|
|
11
|
+
cutlass.conv.Conv2dProblemSize(
|
|
12
|
+
cutlass.Tensor4DCoord(1, 8, 8, channels),
|
|
13
|
+
cutlass.Tensor4DCoord(16, 3, 3, channels),
|
|
14
|
+
cutlass.Tensor4DCoord(1, 1, 1, 1),
|
|
15
|
+
cutlass.MatrixCoord(2, 2),
|
|
16
|
+
cutlass.MatrixCoord(1, 1),
|
|
17
|
+
cutlass.conv.Mode.cross_correlation,
|
|
18
|
+
1, 1
|
|
19
|
+
),
|
|
20
|
+
cutlass.conv.Conv2dProblemSize(
|
|
21
|
+
cutlass.Tensor4DCoord(1, 224, 224, channels),
|
|
22
|
+
cutlass.Tensor4DCoord(32, 7, 7, channels),
|
|
23
|
+
cutlass.Tensor4DCoord(1, 1, 1, 1),
|
|
24
|
+
cutlass.MatrixCoord(1, 1),
|
|
25
|
+
cutlass.MatrixCoord(1, 1),
|
|
26
|
+
cutlass.conv.Mode.cross_correlation,
|
|
27
|
+
1, 1
|
|
28
|
+
),
|
|
29
|
+
cutlass.conv.Conv2dProblemSize(
|
|
30
|
+
cutlass.Tensor4DCoord(1, 224, 224, channels),
|
|
31
|
+
cutlass.Tensor4DCoord(64, 7, 7, channels),
|
|
32
|
+
cutlass.Tensor4DCoord(1, 1, 1, 1),
|
|
33
|
+
cutlass.MatrixCoord(2, 2),
|
|
34
|
+
cutlass.MatrixCoord(1, 1),
|
|
35
|
+
cutlass.conv.Mode.cross_correlation,
|
|
36
|
+
1, 1
|
|
37
|
+
),
|
|
38
|
+
cutlass.conv.Conv2dProblemSize(
|
|
39
|
+
cutlass.Tensor4DCoord(1, 224, 224, channels),
|
|
40
|
+
cutlass.Tensor4DCoord(64, 5, 5, channels),
|
|
41
|
+
cutlass.Tensor4DCoord(1, 1, 1, 1),
|
|
42
|
+
cutlass.MatrixCoord(1, 1),
|
|
43
|
+
cutlass.MatrixCoord(1, 1),
|
|
44
|
+
cutlass.conv.Mode.cross_correlation,
|
|
45
|
+
1, 1
|
|
46
|
+
),
|
|
47
|
+
cutlass.conv.Conv2dProblemSize(
|
|
48
|
+
cutlass.Tensor4DCoord(1, 224, 224, channels),
|
|
49
|
+
cutlass.Tensor4DCoord(64, 5, 5, channels),
|
|
50
|
+
cutlass.Tensor4DCoord(1, 1, 1, 1),
|
|
51
|
+
cutlass.MatrixCoord(2, 2),
|
|
52
|
+
cutlass.MatrixCoord(1, 1),
|
|
53
|
+
cutlass.conv.Mode.cross_correlation,
|
|
54
|
+
1, 1
|
|
55
|
+
),
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
return problem_sizes
|
|
59
|
+
|
|
60
|
+
class Conv2dFpropFixedChannelsF16NHWCF16NHWCF16HNWCTensorOpF32SM80(unittest.TestCase):
|
|
61
|
+
def test_SM80_Device_Conv2d_Fprop_Fixed_Channels_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_channels_8(self):
|
|
62
|
+
math_inst = MathInstruction(
|
|
63
|
+
instruction_shape=[16, 8, 16],
|
|
64
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
65
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.TensorOp,
|
|
66
|
+
math_operation=MathOperation.multiply_add
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
A = TensorDescription(
|
|
70
|
+
element=math_inst.element_a,
|
|
71
|
+
layout=cutlass.TensorNHWC,
|
|
72
|
+
alignment=8)
|
|
73
|
+
B = TensorDescription(
|
|
74
|
+
element=math_inst.element_b,
|
|
75
|
+
layout=cutlass.TensorNHWC,
|
|
76
|
+
alignment=8)
|
|
77
|
+
C = TensorDescription(
|
|
78
|
+
element=cutlass.float16,
|
|
79
|
+
layout=cutlass.TensorNHWC,
|
|
80
|
+
alignment=8)
|
|
81
|
+
|
|
82
|
+
tile_description = TileDescription(
|
|
83
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
84
|
+
warp_count=[2, 2, 1],
|
|
85
|
+
math_instruction=math_inst
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
epilogue_functor = LinearCombination(
|
|
89
|
+
C.element, C.alignment,
|
|
90
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
91
|
+
|
|
92
|
+
operation = Conv2dOperation(
|
|
93
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.fixed_channels,
|
|
94
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
95
|
+
stride_support=StrideSupport.Strided,
|
|
96
|
+
epilogue_functor=epilogue_functor,
|
|
97
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
self.assertTrue(test_all_conv2d(operation, conv2d_fixed_channel_problemsizes(8)))
|
|
101
|
+
|
|
102
|
+
def test_SM80_Device_Conv2d_Fprop_Fixed_Channels_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_channels_4(self):
|
|
103
|
+
math_inst = MathInstruction(
|
|
104
|
+
instruction_shape=[16, 8, 16],
|
|
105
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
106
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.TensorOp,
|
|
107
|
+
math_operation=MathOperation.multiply_add
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
A = TensorDescription(
|
|
111
|
+
element=math_inst.element_a,
|
|
112
|
+
layout=cutlass.TensorNHWC,
|
|
113
|
+
alignment=4)
|
|
114
|
+
B = TensorDescription(
|
|
115
|
+
element=math_inst.element_b,
|
|
116
|
+
layout=cutlass.TensorNHWC,
|
|
117
|
+
alignment=4)
|
|
118
|
+
C = TensorDescription(
|
|
119
|
+
element=cutlass.float16,
|
|
120
|
+
layout=cutlass.TensorNHWC,
|
|
121
|
+
alignment=8)
|
|
122
|
+
|
|
123
|
+
tile_description = TileDescription(
|
|
124
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
125
|
+
warp_count=[2, 2, 1],
|
|
126
|
+
math_instruction=math_inst
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
epilogue_functor = LinearCombination(
|
|
130
|
+
C.element, C.alignment,
|
|
131
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
132
|
+
|
|
133
|
+
operation = Conv2dOperation(
|
|
134
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.fixed_channels,
|
|
135
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
136
|
+
stride_support=StrideSupport.Strided,
|
|
137
|
+
epilogue_functor=epilogue_functor,
|
|
138
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
self.assertTrue(test_all_conv2d(operation, conv2d_fixed_channel_problemsizes(4)))
|
|
142
|
+
|
|
143
|
+
def test_SM80_Device_Conv2d_Fprop_Fixed_Channels_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f32_channels_2(self):
|
|
144
|
+
math_inst = MathInstruction(
|
|
145
|
+
instruction_shape=[16, 8, 16],
|
|
146
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
147
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.TensorOp,
|
|
148
|
+
math_operation=MathOperation.multiply_add
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
A = TensorDescription(
|
|
152
|
+
element=math_inst.element_a,
|
|
153
|
+
layout=cutlass.TensorNHWC,
|
|
154
|
+
alignment=2)
|
|
155
|
+
B = TensorDescription(
|
|
156
|
+
element=math_inst.element_b,
|
|
157
|
+
layout=cutlass.TensorNHWC,
|
|
158
|
+
alignment=2)
|
|
159
|
+
C = TensorDescription(
|
|
160
|
+
element=cutlass.float16,
|
|
161
|
+
layout=cutlass.TensorNHWC,
|
|
162
|
+
alignment=8)
|
|
163
|
+
|
|
164
|
+
tile_description = TileDescription(
|
|
165
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
166
|
+
warp_count=[2, 2, 1],
|
|
167
|
+
math_instruction=math_inst
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
epilogue_functor = LinearCombination(
|
|
171
|
+
C.element, C.alignment,
|
|
172
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
173
|
+
|
|
174
|
+
operation = Conv2dOperation(
|
|
175
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.fixed_channels,
|
|
176
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
177
|
+
stride_support=StrideSupport.Strided,
|
|
178
|
+
epilogue_functor=epilogue_functor,
|
|
179
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
self.assertTrue(test_all_conv2d(operation, conv2d_fixed_channel_problemsizes(2)))
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
if __name__ == '__main__':
|
|
186
|
+
pycutlass.get_memory_pool(2**26, 2**26)
|
|
187
|
+
unittest.main()
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# test/unit/conv/device/conv2d_fprop_implicit_gemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_sm80.cu
|
|
2
|
+
import pycutlass
|
|
3
|
+
from pycutlass import *
|
|
4
|
+
from pycutlass.test import *
|
|
5
|
+
from pycutlass.utils.device import device_cc
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@unittest.skipIf(device_cc() < 80, "Device compute capability is insufficient for SM80 tests.")
|
|
10
|
+
class Conv2dFpropImplicitGemmF16nhwcF16nhwcF16nhwcTensorOpF16SM80(unittest.TestCase):
|
|
11
|
+
def test_SM80_Device_Conv2d_Fprop_Analytic_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16(self):
|
|
12
|
+
math_inst = MathInstruction(
|
|
13
|
+
instruction_shape=[16, 8, 16],
|
|
14
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
15
|
+
element_accumulator=cutlass.float16, opcode_class=cutlass.OpClass.TensorOp,
|
|
16
|
+
math_operation=MathOperation.multiply_add
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
A = TensorDescription(
|
|
20
|
+
element=math_inst.element_a,
|
|
21
|
+
layout=cutlass.TensorNHWC,
|
|
22
|
+
alignment=8)
|
|
23
|
+
B = TensorDescription(
|
|
24
|
+
element=math_inst.element_b,
|
|
25
|
+
layout=cutlass.TensorNHWC,
|
|
26
|
+
alignment=8)
|
|
27
|
+
C = TensorDescription(
|
|
28
|
+
element=cutlass.float16,
|
|
29
|
+
layout=cutlass.TensorNHWC,
|
|
30
|
+
alignment=8)
|
|
31
|
+
|
|
32
|
+
tile_description = TileDescription(
|
|
33
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
34
|
+
warp_count=[2, 2, 1],
|
|
35
|
+
math_instruction=math_inst
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
epilogue_functor = LinearCombination(
|
|
39
|
+
C.element, C.alignment,
|
|
40
|
+
math_inst.element_accumulator, cutlass.float16)
|
|
41
|
+
|
|
42
|
+
operation = Conv2dOperation(
|
|
43
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.analytic,
|
|
44
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
45
|
+
stride_support=StrideSupport.Strided,
|
|
46
|
+
epilogue_functor=epilogue_functor,
|
|
47
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
self.assertTrue(test_all_conv2d(operation))
|
|
51
|
+
|
|
52
|
+
def test_SM80_Device_Conv2d_Fprop_Optimized_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16(self):
|
|
53
|
+
math_inst = MathInstruction(
|
|
54
|
+
instruction_shape=[16, 8, 16],
|
|
55
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
56
|
+
element_accumulator=cutlass.float16, opcode_class=cutlass.OpClass.TensorOp,
|
|
57
|
+
math_operation=MathOperation.multiply_add
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
A = TensorDescription(
|
|
61
|
+
element=math_inst.element_a,
|
|
62
|
+
layout=cutlass.TensorNHWC,
|
|
63
|
+
alignment=8)
|
|
64
|
+
B = TensorDescription(
|
|
65
|
+
element=math_inst.element_b,
|
|
66
|
+
layout=cutlass.TensorNHWC,
|
|
67
|
+
alignment=8)
|
|
68
|
+
C = TensorDescription(
|
|
69
|
+
element=cutlass.float16,
|
|
70
|
+
layout=cutlass.TensorNHWC,
|
|
71
|
+
alignment=8)
|
|
72
|
+
|
|
73
|
+
tile_description = TileDescription(
|
|
74
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
75
|
+
warp_count=[2, 2, 1],
|
|
76
|
+
math_instruction=math_inst
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
epilogue_functor = LinearCombination(
|
|
80
|
+
C.element, C.alignment,
|
|
81
|
+
math_inst.element_accumulator, cutlass.float16)
|
|
82
|
+
|
|
83
|
+
operation = Conv2dOperation(
|
|
84
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.optimized,
|
|
85
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
86
|
+
stride_support=StrideSupport.Strided,
|
|
87
|
+
epilogue_functor=epilogue_functor,
|
|
88
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
self.assertTrue(test_all_conv2d(operation))
|
|
92
|
+
|
|
93
|
+
def test_SM80_Device_Conv2d_Fprop_Analytic_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_align2(self):
|
|
94
|
+
math_inst = MathInstruction(
|
|
95
|
+
instruction_shape=[16, 8, 16],
|
|
96
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
97
|
+
element_accumulator=cutlass.float16, opcode_class=cutlass.OpClass.TensorOp,
|
|
98
|
+
math_operation=MathOperation.multiply_add
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
A = TensorDescription(
|
|
102
|
+
element=math_inst.element_a,
|
|
103
|
+
layout=cutlass.TensorNHWC,
|
|
104
|
+
alignment=2)
|
|
105
|
+
B = TensorDescription(
|
|
106
|
+
element=math_inst.element_b,
|
|
107
|
+
layout=cutlass.TensorNHWC,
|
|
108
|
+
alignment=2)
|
|
109
|
+
C = TensorDescription(
|
|
110
|
+
element=cutlass.float16,
|
|
111
|
+
layout=cutlass.TensorNHWC,
|
|
112
|
+
alignment=8)
|
|
113
|
+
|
|
114
|
+
tile_description = TileDescription(
|
|
115
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
116
|
+
warp_count=[2, 2, 1],
|
|
117
|
+
math_instruction=math_inst
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
epilogue_functor = LinearCombination(
|
|
121
|
+
C.element, C.alignment,
|
|
122
|
+
math_inst.element_accumulator, cutlass.float16)
|
|
123
|
+
|
|
124
|
+
operation = Conv2dOperation(
|
|
125
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.analytic,
|
|
126
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
127
|
+
stride_support=StrideSupport.Strided,
|
|
128
|
+
epilogue_functor=epilogue_functor,
|
|
129
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
problem_sizes = [
|
|
133
|
+
cutlass.conv.Conv2dProblemSize(
|
|
134
|
+
cutlass.Tensor4DCoord(1, 4, 4, 12),
|
|
135
|
+
cutlass.Tensor4DCoord(8, 3, 3, 12),
|
|
136
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
137
|
+
cutlass.MatrixCoord(3, 3),
|
|
138
|
+
cutlass.MatrixCoord(1, 1),
|
|
139
|
+
cutlass.conv.Mode.cross_correlation,
|
|
140
|
+
1, 1
|
|
141
|
+
),
|
|
142
|
+
cutlass.conv.Conv2dProblemSize(
|
|
143
|
+
cutlass.Tensor4DCoord(1, 4, 4, 14),
|
|
144
|
+
cutlass.Tensor4DCoord(8, 3, 3, 14),
|
|
145
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
146
|
+
cutlass.MatrixCoord(3, 3),
|
|
147
|
+
cutlass.MatrixCoord(1, 1),
|
|
148
|
+
cutlass.conv.Mode.cross_correlation,
|
|
149
|
+
1, 1
|
|
150
|
+
),
|
|
151
|
+
cutlass.conv.Conv2dProblemSize(
|
|
152
|
+
cutlass.Tensor4DCoord(1, 23, 56, 98),
|
|
153
|
+
cutlass.Tensor4DCoord(128, 3, 3, 98),
|
|
154
|
+
cutlass.Tensor4DCoord(4, 0, 5, 0),
|
|
155
|
+
cutlass.MatrixCoord(3, 3),
|
|
156
|
+
cutlass.MatrixCoord(1, 1),
|
|
157
|
+
cutlass.conv.Mode.cross_correlation,
|
|
158
|
+
1, 1
|
|
159
|
+
),
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
self.assertTrue(test_all_conv2d(operation, problem_sizes))
|
|
163
|
+
|
|
164
|
+
def test_SM80_Device_Conv2d_Fprop_Optimized_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_align2(self):
|
|
165
|
+
math_inst = MathInstruction(
|
|
166
|
+
instruction_shape=[16, 8, 16],
|
|
167
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
168
|
+
element_accumulator=cutlass.float16, opcode_class=cutlass.OpClass.TensorOp,
|
|
169
|
+
math_operation=MathOperation.multiply_add
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
A = TensorDescription(
|
|
173
|
+
element=math_inst.element_a,
|
|
174
|
+
layout=cutlass.TensorNHWC,
|
|
175
|
+
alignment=2)
|
|
176
|
+
B = TensorDescription(
|
|
177
|
+
element=math_inst.element_b,
|
|
178
|
+
layout=cutlass.TensorNHWC,
|
|
179
|
+
alignment=2)
|
|
180
|
+
C = TensorDescription(
|
|
181
|
+
element=cutlass.float16,
|
|
182
|
+
layout=cutlass.TensorNHWC,
|
|
183
|
+
alignment=8)
|
|
184
|
+
|
|
185
|
+
tile_description = TileDescription(
|
|
186
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
187
|
+
warp_count=[2, 2, 1],
|
|
188
|
+
math_instruction=math_inst
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
epilogue_functor = LinearCombination(
|
|
192
|
+
C.element, C.alignment,
|
|
193
|
+
math_inst.element_accumulator, cutlass.float16)
|
|
194
|
+
|
|
195
|
+
operation = Conv2dOperation(
|
|
196
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.optimized,
|
|
197
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
198
|
+
stride_support=StrideSupport.Strided,
|
|
199
|
+
epilogue_functor=epilogue_functor,
|
|
200
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
problem_sizes = [
|
|
204
|
+
cutlass.conv.Conv2dProblemSize(
|
|
205
|
+
cutlass.Tensor4DCoord(1, 4, 4, 12),
|
|
206
|
+
cutlass.Tensor4DCoord(8, 3, 3, 12),
|
|
207
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
208
|
+
cutlass.MatrixCoord(3, 3),
|
|
209
|
+
cutlass.MatrixCoord(1, 1),
|
|
210
|
+
cutlass.conv.Mode.cross_correlation,
|
|
211
|
+
1, 1
|
|
212
|
+
),
|
|
213
|
+
cutlass.conv.Conv2dProblemSize(
|
|
214
|
+
cutlass.Tensor4DCoord(1, 4, 4, 14),
|
|
215
|
+
cutlass.Tensor4DCoord(8, 3, 3, 14),
|
|
216
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
217
|
+
cutlass.MatrixCoord(3, 3),
|
|
218
|
+
cutlass.MatrixCoord(1, 1),
|
|
219
|
+
cutlass.conv.Mode.cross_correlation,
|
|
220
|
+
1, 1
|
|
221
|
+
),
|
|
222
|
+
cutlass.conv.Conv2dProblemSize(
|
|
223
|
+
cutlass.Tensor4DCoord(1, 23, 56, 98),
|
|
224
|
+
cutlass.Tensor4DCoord(128, 3, 3, 98),
|
|
225
|
+
cutlass.Tensor4DCoord(4, 0, 5, 0),
|
|
226
|
+
cutlass.MatrixCoord(3, 3),
|
|
227
|
+
cutlass.MatrixCoord(1, 1),
|
|
228
|
+
cutlass.conv.Mode.cross_correlation,
|
|
229
|
+
1, 1
|
|
230
|
+
),
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
self.assertTrue(test_all_conv2d(operation, problem_sizes))
|
|
234
|
+
|
|
235
|
+
def test_SM80_Device_Conv2d_Fprop_Analytic_ImplicitGemm_f16nhwc_f16nhwc_f16nhwc_tensor_op_f16_align4(self):
|
|
236
|
+
math_inst = MathInstruction(
|
|
237
|
+
instruction_shape=[16, 8, 16],
|
|
238
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
239
|
+
element_accumulator=cutlass.float16, opcode_class=cutlass.OpClass.TensorOp,
|
|
240
|
+
math_operation=MathOperation.multiply_add
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
A = TensorDescription(
|
|
244
|
+
element=math_inst.element_a,
|
|
245
|
+
layout=cutlass.TensorNHWC,
|
|
246
|
+
alignment=4)
|
|
247
|
+
B = TensorDescription(
|
|
248
|
+
element=math_inst.element_b,
|
|
249
|
+
layout=cutlass.TensorNHWC,
|
|
250
|
+
alignment=4)
|
|
251
|
+
C = TensorDescription(
|
|
252
|
+
element=cutlass.float16,
|
|
253
|
+
layout=cutlass.TensorNHWC,
|
|
254
|
+
alignment=8)
|
|
255
|
+
|
|
256
|
+
tile_description = TileDescription(
|
|
257
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
258
|
+
warp_count=[2, 2, 1],
|
|
259
|
+
math_instruction=math_inst
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
epilogue_functor = LinearCombination(
|
|
263
|
+
C.element, C.alignment,
|
|
264
|
+
math_inst.element_accumulator, cutlass.float16)
|
|
265
|
+
|
|
266
|
+
operation = Conv2dOperation(
|
|
267
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.optimized,
|
|
268
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
269
|
+
stride_support=StrideSupport.Strided,
|
|
270
|
+
epilogue_functor=epilogue_functor,
|
|
271
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
problem_sizes = [
|
|
275
|
+
cutlass.conv.Conv2dProblemSize(
|
|
276
|
+
cutlass.Tensor4DCoord(1, 4, 4, 12),
|
|
277
|
+
cutlass.Tensor4DCoord(8, 3, 3, 12),
|
|
278
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
279
|
+
cutlass.MatrixCoord(3, 3),
|
|
280
|
+
cutlass.MatrixCoord(1, 1),
|
|
281
|
+
cutlass.conv.Mode.cross_correlation,
|
|
282
|
+
1, 1
|
|
283
|
+
),
|
|
284
|
+
cutlass.conv.Conv2dProblemSize(
|
|
285
|
+
cutlass.Tensor4DCoord(1, 4, 4, 28),
|
|
286
|
+
cutlass.Tensor4DCoord(8, 3, 3, 28),
|
|
287
|
+
cutlass.Tensor4DCoord(0, 0, 0, 0),
|
|
288
|
+
cutlass.MatrixCoord(3, 3),
|
|
289
|
+
cutlass.MatrixCoord(1, 1),
|
|
290
|
+
cutlass.conv.Mode.cross_correlation,
|
|
291
|
+
1, 1
|
|
292
|
+
),
|
|
293
|
+
cutlass.conv.Conv2dProblemSize(
|
|
294
|
+
cutlass.Tensor4DCoord(1, 23, 56, 100),
|
|
295
|
+
cutlass.Tensor4DCoord(128, 3, 3, 100),
|
|
296
|
+
cutlass.Tensor4DCoord(4, 0, 5, 0),
|
|
297
|
+
cutlass.MatrixCoord(3, 3),
|
|
298
|
+
cutlass.MatrixCoord(1, 1),
|
|
299
|
+
cutlass.conv.Mode.cross_correlation,
|
|
300
|
+
1, 1
|
|
301
|
+
),
|
|
302
|
+
]
|
|
303
|
+
|
|
304
|
+
self.assertTrue(test_all_conv2d(operation, problem_sizes))
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
if __name__ == '__main__':
|
|
308
|
+
pycutlass.get_memory_pool(2**26, 2**26)
|
|
309
|
+
unittest.main()
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# test/unit/conv/device/conv2d_fprop_implicit_gemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32_sm80.cu
|
|
2
|
+
import pycutlass
|
|
3
|
+
from pycutlass import *
|
|
4
|
+
from pycutlass.test import *
|
|
5
|
+
from pycutlass.utils.device import device_cc
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@unittest.skipIf(device_cc() < 80, "Device compute capability is insufficient for SM80 tests.")
|
|
10
|
+
class Conv2dFpropImplicitGemmF16nhwcF16nhwcF32nhwcTensorOpF32SM80(unittest.TestCase):
|
|
11
|
+
def test_SM80_Device_Conv2d_Fprop_Analytic_ImplicitGemm_f16nhwc_f16nhwc_f32nhwc_tensor_op_f32(self):
|
|
12
|
+
math_inst = MathInstruction(
|
|
13
|
+
instruction_shape=[16, 8, 16],
|
|
14
|
+
element_a=cutlass.float16, element_b=cutlass.float16,
|
|
15
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.TensorOp,
|
|
16
|
+
math_operation=MathOperation.multiply_add
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
A = TensorDescription(
|
|
20
|
+
element=math_inst.element_a,
|
|
21
|
+
layout=cutlass.TensorNHWC,
|
|
22
|
+
alignment=8)
|
|
23
|
+
B = TensorDescription(
|
|
24
|
+
element=math_inst.element_b,
|
|
25
|
+
layout=cutlass.TensorNHWC,
|
|
26
|
+
alignment=8)
|
|
27
|
+
C = TensorDescription(
|
|
28
|
+
element=cutlass.float32,
|
|
29
|
+
layout=cutlass.TensorNHWC,
|
|
30
|
+
alignment=4)
|
|
31
|
+
|
|
32
|
+
tile_description = TileDescription(
|
|
33
|
+
threadblock_shape=[128, 128, 64], stages=3,
|
|
34
|
+
warp_count=[2, 2, 1],
|
|
35
|
+
math_instruction=math_inst
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
epilogue_functor = LinearCombination(
|
|
39
|
+
C.element, C.alignment,
|
|
40
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
41
|
+
|
|
42
|
+
operation = Conv2dOperation(
|
|
43
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.analytic,
|
|
44
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
45
|
+
stride_support=StrideSupport.Strided,
|
|
46
|
+
epilogue_functor=epilogue_functor,
|
|
47
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
self.assertTrue(test_all_conv2d(operation))
|
|
51
|
+
|
|
52
|
+
if __name__ == '__main__':
|
|
53
|
+
pycutlass.get_memory_pool(2**26, 2**26)
|
|
54
|
+
unittest.main()
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# test/unit/conv/device/conv2d_fprop_implicit_gemm_f32nhwc_f32nhwc_f32nhwc_simt_f32_sm80.cu
|
|
2
|
+
import pycutlass
|
|
3
|
+
from pycutlass.conv2d_operation import *
|
|
4
|
+
from pycutlass import *
|
|
5
|
+
from pycutlass.test import *
|
|
6
|
+
from pycutlass.utils.device import device_cc
|
|
7
|
+
import unittest
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@unittest.skipIf(device_cc() < 80, "Device compute capability is insufficient for SM80 tests.")
|
|
11
|
+
class Conv2dFpropImplicitGemmF32nhwcF32nhwcF32nhwcSimtF32SM80(unittest.TestCase):
|
|
12
|
+
def test_SM80_Device_Conv2d_Fprop_Analytic_ImplicitGemm_f32nhwc_f32nhwc_f32nhwc_simt_f32(self):
|
|
13
|
+
math_inst = MathInstruction(
|
|
14
|
+
instruction_shape=[1, 1, 1],
|
|
15
|
+
element_a=cutlass.float32, element_b=cutlass.float32,
|
|
16
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.Simt,
|
|
17
|
+
math_operation=MathOperation.multiply_add
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
A = TensorDescription(
|
|
21
|
+
element=math_inst.element_a,
|
|
22
|
+
layout=cutlass.TensorNHWC,
|
|
23
|
+
alignment=4)
|
|
24
|
+
B = TensorDescription(
|
|
25
|
+
element=math_inst.element_b,
|
|
26
|
+
layout=cutlass.TensorNHWC,
|
|
27
|
+
alignment=4)
|
|
28
|
+
C = TensorDescription(
|
|
29
|
+
element=cutlass.float32,
|
|
30
|
+
layout=cutlass.TensorNHWC,
|
|
31
|
+
alignment=1)
|
|
32
|
+
|
|
33
|
+
tile_description = TileDescription(
|
|
34
|
+
threadblock_shape=[128, 128, 8], stages=4,
|
|
35
|
+
warp_count=[4, 2, 1],
|
|
36
|
+
math_instruction=math_inst
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
epilogue_functor = LinearCombination(
|
|
40
|
+
C.element, C.alignment,
|
|
41
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
42
|
+
|
|
43
|
+
operation = Conv2dOperation(
|
|
44
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.analytic,
|
|
45
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
46
|
+
stride_support=StrideSupport.Strided,
|
|
47
|
+
epilogue_functor=epilogue_functor,
|
|
48
|
+
swizzling_functor=cutlass.IdentitySwizzle2
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
self.assertTrue(test_all_conv2d(operation))
|
|
52
|
+
|
|
53
|
+
def test_SM80_Device_Conv2d_Fprop_Optimized_ImplicitGemm_f32nhwc_f32nhwc_f32nhwc_simt_f32(self):
|
|
54
|
+
math_inst = MathInstruction(
|
|
55
|
+
instruction_shape=[1, 1, 1],
|
|
56
|
+
element_a=cutlass.float32, element_b=cutlass.float32,
|
|
57
|
+
element_accumulator=cutlass.float32, opcode_class=cutlass.OpClass.Simt,
|
|
58
|
+
math_operation=MathOperation.multiply_add
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
A = TensorDescription(
|
|
62
|
+
element=math_inst.element_a,
|
|
63
|
+
layout=cutlass.TensorNHWC,
|
|
64
|
+
alignment=4)
|
|
65
|
+
B = TensorDescription(
|
|
66
|
+
element=math_inst.element_b,
|
|
67
|
+
layout=cutlass.TensorNHWC,
|
|
68
|
+
alignment=4)
|
|
69
|
+
C = TensorDescription(
|
|
70
|
+
element=cutlass.float32,
|
|
71
|
+
layout=cutlass.TensorNHWC,
|
|
72
|
+
alignment=1)
|
|
73
|
+
|
|
74
|
+
tile_description = TileDescription(
|
|
75
|
+
threadblock_shape=[128, 128, 8], stages=4,
|
|
76
|
+
warp_count=[2, 4, 1],
|
|
77
|
+
math_instruction=math_inst
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
epilogue_functor = LinearCombination(
|
|
81
|
+
C.element, C.alignment,
|
|
82
|
+
math_inst.element_accumulator, cutlass.float32)
|
|
83
|
+
|
|
84
|
+
operation = Conv2dOperation(
|
|
85
|
+
conv_kind=cutlass.conv.Operator.fprop, iterator_algorithm=cutlass.conv.IteratorAlgorithm.optimized,
|
|
86
|
+
arch=80, tile_description=tile_description, A=A, B=B, C=C,
|
|
87
|
+
stride_support=StrideSupport.Strided,
|
|
88
|
+
epilogue_functor=epilogue_functor,
|
|
89
|
+
swizzling_functor=cutlass.IdentitySwizzle1
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
self.assertTrue(test_all_conv2d(operation))
|
|
93
|
+
|
|
94
|
+
if __name__ == '__main__':
|
|
95
|
+
pycutlass.get_memory_pool(2**26, 2**26)
|
|
96
|
+
unittest.main()
|