warp-lang 1.5.1__py3-none-win_amd64.whl → 1.6.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.

Files changed (123) hide show
  1. warp/__init__.py +5 -0
  2. warp/autograd.py +414 -191
  3. warp/bin/warp-clang.dll +0 -0
  4. warp/bin/warp.dll +0 -0
  5. warp/build.py +40 -12
  6. warp/build_dll.py +13 -6
  7. warp/builtins.py +1076 -480
  8. warp/codegen.py +240 -119
  9. warp/config.py +1 -1
  10. warp/context.py +298 -84
  11. warp/examples/assets/square_cloth.usd +0 -0
  12. warp/examples/benchmarks/benchmark_gemm.py +27 -18
  13. warp/examples/benchmarks/benchmark_interop_paddle.py +3 -3
  14. warp/examples/benchmarks/benchmark_interop_torch.py +3 -3
  15. warp/examples/core/example_torch.py +18 -34
  16. warp/examples/fem/example_apic_fluid.py +1 -0
  17. warp/examples/fem/example_mixed_elasticity.py +1 -1
  18. warp/examples/optim/example_bounce.py +1 -1
  19. warp/examples/optim/example_cloth_throw.py +1 -1
  20. warp/examples/optim/example_diffray.py +4 -15
  21. warp/examples/optim/example_drone.py +1 -1
  22. warp/examples/optim/example_softbody_properties.py +392 -0
  23. warp/examples/optim/example_trajectory.py +1 -3
  24. warp/examples/optim/example_walker.py +5 -0
  25. warp/examples/sim/example_cartpole.py +0 -2
  26. warp/examples/sim/example_cloth_self_contact.py +260 -0
  27. warp/examples/sim/example_granular_collision_sdf.py +4 -5
  28. warp/examples/sim/example_jacobian_ik.py +0 -2
  29. warp/examples/sim/example_quadruped.py +5 -2
  30. warp/examples/tile/example_tile_cholesky.py +79 -0
  31. warp/examples/tile/example_tile_convolution.py +2 -2
  32. warp/examples/tile/example_tile_fft.py +2 -2
  33. warp/examples/tile/example_tile_filtering.py +3 -3
  34. warp/examples/tile/example_tile_matmul.py +4 -4
  35. warp/examples/tile/example_tile_mlp.py +12 -12
  36. warp/examples/tile/example_tile_nbody.py +180 -0
  37. warp/examples/tile/example_tile_walker.py +319 -0
  38. warp/math.py +147 -0
  39. warp/native/array.h +12 -0
  40. warp/native/builtin.h +0 -1
  41. warp/native/bvh.cpp +149 -70
  42. warp/native/bvh.cu +287 -68
  43. warp/native/bvh.h +195 -85
  44. warp/native/clang/clang.cpp +5 -1
  45. warp/native/cuda_util.cpp +35 -0
  46. warp/native/cuda_util.h +5 -0
  47. warp/native/exports.h +40 -40
  48. warp/native/intersect.h +17 -0
  49. warp/native/mat.h +41 -0
  50. warp/native/mathdx.cpp +19 -0
  51. warp/native/mesh.cpp +25 -8
  52. warp/native/mesh.cu +153 -101
  53. warp/native/mesh.h +482 -403
  54. warp/native/quat.h +40 -0
  55. warp/native/solid_angle.h +7 -0
  56. warp/native/sort.cpp +85 -0
  57. warp/native/sort.cu +34 -0
  58. warp/native/sort.h +3 -1
  59. warp/native/spatial.h +11 -0
  60. warp/native/tile.h +1185 -664
  61. warp/native/tile_reduce.h +8 -6
  62. warp/native/vec.h +41 -0
  63. warp/native/warp.cpp +8 -1
  64. warp/native/warp.cu +263 -40
  65. warp/native/warp.h +19 -5
  66. warp/optim/linear.py +22 -4
  67. warp/render/render_opengl.py +124 -59
  68. warp/sim/__init__.py +6 -1
  69. warp/sim/collide.py +270 -26
  70. warp/sim/integrator_euler.py +25 -7
  71. warp/sim/integrator_featherstone.py +154 -35
  72. warp/sim/integrator_vbd.py +842 -40
  73. warp/sim/model.py +111 -53
  74. warp/stubs.py +248 -115
  75. warp/tape.py +28 -30
  76. warp/tests/aux_test_module_unload.py +15 -0
  77. warp/tests/{test_sim_grad.py → flaky_test_sim_grad.py} +104 -63
  78. warp/tests/test_array.py +74 -0
  79. warp/tests/test_assert.py +242 -0
  80. warp/tests/test_codegen.py +14 -61
  81. warp/tests/test_collision.py +2 -2
  82. warp/tests/test_examples.py +9 -0
  83. warp/tests/test_grad_debug.py +87 -2
  84. warp/tests/test_hash_grid.py +1 -1
  85. warp/tests/test_ipc.py +116 -0
  86. warp/tests/test_mat.py +138 -167
  87. warp/tests/test_math.py +47 -1
  88. warp/tests/test_matmul.py +11 -7
  89. warp/tests/test_matmul_lite.py +4 -4
  90. warp/tests/test_mesh.py +84 -60
  91. warp/tests/test_mesh_query_aabb.py +165 -0
  92. warp/tests/test_mesh_query_point.py +328 -286
  93. warp/tests/test_mesh_query_ray.py +134 -121
  94. warp/tests/test_mlp.py +2 -2
  95. warp/tests/test_operators.py +43 -0
  96. warp/tests/test_overwrite.py +2 -2
  97. warp/tests/test_quat.py +77 -0
  98. warp/tests/test_reload.py +29 -0
  99. warp/tests/test_sim_grad_bounce_linear.py +204 -0
  100. warp/tests/test_static.py +16 -0
  101. warp/tests/test_tape.py +25 -0
  102. warp/tests/test_tile.py +134 -191
  103. warp/tests/test_tile_load.py +356 -0
  104. warp/tests/test_tile_mathdx.py +61 -8
  105. warp/tests/test_tile_mlp.py +17 -17
  106. warp/tests/test_tile_reduce.py +24 -18
  107. warp/tests/test_tile_shared_memory.py +66 -17
  108. warp/tests/test_tile_view.py +165 -0
  109. warp/tests/test_torch.py +35 -0
  110. warp/tests/test_utils.py +36 -24
  111. warp/tests/test_vec.py +110 -0
  112. warp/tests/unittest_suites.py +29 -4
  113. warp/tests/unittest_utils.py +30 -11
  114. warp/thirdparty/unittest_parallel.py +2 -2
  115. warp/types.py +409 -99
  116. warp/utils.py +9 -5
  117. {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/METADATA +68 -44
  118. {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/RECORD +121 -110
  119. {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/WHEEL +1 -1
  120. warp/examples/benchmarks/benchmark_tile.py +0 -179
  121. warp/native/tile_gemm.h +0 -341
  122. {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/LICENSE.md +0 -0
  123. {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/top_level.txt +0 -0
warp/bin/warp-clang.dll CHANGED
Binary file
warp/bin/warp.dll CHANGED
Binary file
warp/build.py CHANGED
@@ -11,27 +11,50 @@ import os
11
11
  import warp.config
12
12
  from warp.thirdparty import appdirs
13
13
 
14
+ # From nvJitLink.h
15
+ nvJitLink_input_type = {"cubin": 1, "ptx": 2, "ltoir": 3, "fatbin": 4, "object": 5, "library": 6}
16
+
14
17
 
15
18
  # builds cuda source to PTX or CUBIN using NVRTC (output type determined by output_path extension)
16
- def build_cuda(cu_path, arch, output_path, config="release", verify_fp=False, fast_math=False, ltoirs=None):
19
+ def build_cuda(
20
+ cu_path,
21
+ arch,
22
+ output_path,
23
+ config="release",
24
+ verify_fp=False,
25
+ fast_math=False,
26
+ fuse_fp=True,
27
+ lineinfo=False,
28
+ ltoirs=None,
29
+ fatbins=None,
30
+ ) -> None:
17
31
  with open(cu_path, "rb") as src_file:
18
32
  src = src_file.read()
19
- cu_path = cu_path.encode("utf-8")
33
+ cu_path_bytes = cu_path.encode("utf-8")
34
+ program_name_bytes = os.path.basename(cu_path).encode("utf-8")
20
35
  inc_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "native").encode("utf-8")
21
36
  output_path = output_path.encode("utf-8")
22
37
 
23
38
  if warp.config.llvm_cuda:
24
- warp.context.runtime.llvm.compile_cuda(src, cu_path, inc_path, output_path, False)
39
+ warp.context.runtime.llvm.compile_cuda(src, cu_path_bytes, inc_path, output_path, False)
25
40
 
26
41
  else:
27
42
  if ltoirs is None:
28
43
  ltoirs = []
29
-
30
- num_ltoirs = len(ltoirs)
31
- arr_lroirs = (ctypes.c_char_p * num_ltoirs)(*ltoirs)
32
- arr_lroir_sizes = (ctypes.c_size_t * num_ltoirs)(*[len(l) for l in ltoirs])
44
+ if fatbins is None:
45
+ fatbins = []
46
+
47
+ link_data = list(ltoirs) + list(fatbins)
48
+ num_link = len(link_data)
49
+ arr_link = (ctypes.c_char_p * num_link)(*link_data)
50
+ arr_link_sizes = (ctypes.c_size_t * num_link)(*[len(l) for l in link_data])
51
+ link_input_types = [nvJitLink_input_type["ltoir"]] * len(ltoirs) + [nvJitLink_input_type["fatbin"]] * len(
52
+ fatbins
53
+ )
54
+ arr_link_input_types = (ctypes.c_int * num_link)(*link_input_types)
33
55
  err = warp.context.runtime.core.cuda_compile_program(
34
56
  src,
57
+ program_name_bytes,
35
58
  arch,
36
59
  inc_path,
37
60
  0,
@@ -40,10 +63,13 @@ def build_cuda(cu_path, arch, output_path, config="release", verify_fp=False, fa
40
63
  warp.config.verbose,
41
64
  verify_fp,
42
65
  fast_math,
66
+ fuse_fp,
67
+ lineinfo,
43
68
  output_path,
44
- num_ltoirs,
45
- arr_lroirs,
46
- arr_lroir_sizes,
69
+ num_link,
70
+ arr_link,
71
+ arr_link_sizes,
72
+ arr_link_input_types,
47
73
  )
48
74
  if err != 0:
49
75
  raise Exception(f"CUDA kernel build failed with error code {err}")
@@ -57,14 +83,16 @@ def load_cuda(input_path, device):
57
83
  return warp.context.runtime.core.cuda_load_module(device.context, input_path.encode("utf-8"))
58
84
 
59
85
 
60
- def build_cpu(obj_path, cpp_path, mode="release", verify_fp=False, fast_math=False):
86
+ def build_cpu(obj_path, cpp_path, mode="release", verify_fp=False, fast_math=False, fuse_fp=True):
61
87
  with open(cpp_path, "rb") as cpp:
62
88
  src = cpp.read()
63
89
  cpp_path = cpp_path.encode("utf-8")
64
90
  inc_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "native").encode("utf-8")
65
91
  obj_path = obj_path.encode("utf-8")
66
92
 
67
- err = warp.context.runtime.llvm.compile_cpp(src, cpp_path, inc_path, obj_path, mode == "debug", verify_fp)
93
+ err = warp.context.runtime.llvm.compile_cpp(
94
+ src, cpp_path, inc_path, obj_path, mode == "debug", verify_fp, fuse_fp
95
+ )
68
96
  if err != 0:
69
97
  raise Exception(f"CPU kernel build failed with error code {err}")
70
98
 
warp/build_dll.py CHANGED
@@ -202,18 +202,25 @@ def build_dll_for_arch(args, dll_path, cpp_paths, cu_path, libs, arch, mode=None
202
202
  "-gencode=arch=compute_87,code=sm_87", # Orin
203
203
  ]
204
204
 
205
- # support for Ada and Hopper is available with CUDA Toolkit 11.8+
206
- if ctk_version >= (11, 8):
205
+ if ctk_version >= (12, 8):
206
+ # Support for Blackwell is available with CUDA Toolkit 12.8+
207
207
  gencode_opts += [
208
208
  "-gencode=arch=compute_89,code=sm_89", # Ada
209
209
  "-gencode=arch=compute_90,code=sm_90", # Hopper
210
- # PTX for future hardware
211
- "-gencode=arch=compute_90,code=compute_90",
210
+ "-gencode=arch=compute_100,code=sm_100", # Blackwell
211
+ "-gencode=arch=compute_120,code=sm_120", # Blackwell
212
+ "-gencode=arch=compute_120,code=compute_120", # PTX for future hardware
213
+ ]
214
+ elif ctk_version >= (11, 8):
215
+ # Support for Ada and Hopper is available with CUDA Toolkit 11.8+
216
+ gencode_opts += [
217
+ "-gencode=arch=compute_89,code=sm_89", # Ada
218
+ "-gencode=arch=compute_90,code=sm_90", # Hopper
219
+ "-gencode=arch=compute_90,code=compute_90", # PTX for future hardware
212
220
  ]
213
221
  else:
214
222
  gencode_opts += [
215
- # PTX for future hardware
216
- "-gencode=arch=compute_86,code=compute_86",
223
+ "-gencode=arch=compute_86,code=compute_86", # PTX for future hardware
217
224
  ]
218
225
 
219
226
  nvcc_opts = gencode_opts + [