warp-lang 1.5.0__py3-none-manylinux2014_x86_64.whl → 1.6.0__py3-none-manylinux2014_x86_64.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 (132) hide show
  1. warp/__init__.py +5 -0
  2. warp/autograd.py +414 -191
  3. warp/bin/warp-clang.so +0 -0
  4. warp/bin/warp.so +0 -0
  5. warp/build.py +40 -12
  6. warp/build_dll.py +13 -6
  7. warp/builtins.py +1124 -497
  8. warp/codegen.py +261 -136
  9. warp/config.py +1 -1
  10. warp/context.py +357 -119
  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.py +3 -1
  27. warp/examples/sim/example_cloth_self_contact.py +260 -0
  28. warp/examples/sim/example_granular_collision_sdf.py +4 -5
  29. warp/examples/sim/example_jacobian_ik.py +0 -2
  30. warp/examples/sim/example_quadruped.py +5 -2
  31. warp/examples/tile/example_tile_cholesky.py +79 -0
  32. warp/examples/tile/example_tile_convolution.py +2 -2
  33. warp/examples/tile/example_tile_fft.py +2 -2
  34. warp/examples/tile/example_tile_filtering.py +3 -3
  35. warp/examples/tile/example_tile_matmul.py +4 -4
  36. warp/examples/tile/example_tile_mlp.py +12 -12
  37. warp/examples/tile/example_tile_nbody.py +180 -0
  38. warp/examples/tile/example_tile_walker.py +319 -0
  39. warp/fem/geometry/geometry.py +0 -2
  40. warp/math.py +147 -0
  41. warp/native/array.h +12 -0
  42. warp/native/builtin.h +0 -1
  43. warp/native/bvh.cpp +149 -70
  44. warp/native/bvh.cu +287 -68
  45. warp/native/bvh.h +195 -85
  46. warp/native/clang/clang.cpp +5 -1
  47. warp/native/coloring.cpp +5 -1
  48. warp/native/cuda_util.cpp +91 -53
  49. warp/native/cuda_util.h +5 -0
  50. warp/native/exports.h +40 -40
  51. warp/native/intersect.h +17 -0
  52. warp/native/mat.h +41 -0
  53. warp/native/mathdx.cpp +19 -0
  54. warp/native/mesh.cpp +25 -8
  55. warp/native/mesh.cu +153 -101
  56. warp/native/mesh.h +482 -403
  57. warp/native/quat.h +40 -0
  58. warp/native/solid_angle.h +7 -0
  59. warp/native/sort.cpp +85 -0
  60. warp/native/sort.cu +34 -0
  61. warp/native/sort.h +3 -1
  62. warp/native/spatial.h +11 -0
  63. warp/native/tile.h +1187 -669
  64. warp/native/tile_reduce.h +8 -6
  65. warp/native/vec.h +41 -0
  66. warp/native/warp.cpp +8 -1
  67. warp/native/warp.cu +263 -40
  68. warp/native/warp.h +19 -5
  69. warp/optim/linear.py +22 -4
  70. warp/render/render_opengl.py +130 -64
  71. warp/sim/__init__.py +6 -1
  72. warp/sim/collide.py +270 -26
  73. warp/sim/import_urdf.py +8 -8
  74. warp/sim/integrator_euler.py +25 -7
  75. warp/sim/integrator_featherstone.py +154 -35
  76. warp/sim/integrator_vbd.py +842 -40
  77. warp/sim/model.py +134 -72
  78. warp/sparse.py +1 -1
  79. warp/stubs.py +265 -132
  80. warp/tape.py +28 -30
  81. warp/tests/aux_test_module_unload.py +15 -0
  82. warp/tests/{test_sim_grad.py → flaky_test_sim_grad.py} +104 -63
  83. warp/tests/test_array.py +74 -0
  84. warp/tests/test_assert.py +242 -0
  85. warp/tests/test_codegen.py +14 -61
  86. warp/tests/test_collision.py +2 -2
  87. warp/tests/test_coloring.py +12 -2
  88. warp/tests/test_examples.py +12 -1
  89. warp/tests/test_func.py +21 -4
  90. warp/tests/test_grad_debug.py +87 -2
  91. warp/tests/test_hash_grid.py +1 -1
  92. warp/tests/test_ipc.py +116 -0
  93. warp/tests/test_lerp.py +13 -87
  94. warp/tests/test_mat.py +138 -167
  95. warp/tests/test_math.py +47 -1
  96. warp/tests/test_matmul.py +17 -16
  97. warp/tests/test_matmul_lite.py +10 -15
  98. warp/tests/test_mesh.py +84 -60
  99. warp/tests/test_mesh_query_aabb.py +165 -0
  100. warp/tests/test_mesh_query_point.py +328 -286
  101. warp/tests/test_mesh_query_ray.py +134 -121
  102. warp/tests/test_mlp.py +2 -2
  103. warp/tests/test_operators.py +43 -0
  104. warp/tests/test_overwrite.py +47 -2
  105. warp/tests/test_quat.py +77 -0
  106. warp/tests/test_reload.py +29 -0
  107. warp/tests/test_sim_grad_bounce_linear.py +204 -0
  108. warp/tests/test_smoothstep.py +17 -83
  109. warp/tests/test_static.py +19 -3
  110. warp/tests/test_tape.py +25 -0
  111. warp/tests/test_tile.py +178 -191
  112. warp/tests/test_tile_load.py +356 -0
  113. warp/tests/test_tile_mathdx.py +61 -8
  114. warp/tests/test_tile_mlp.py +17 -17
  115. warp/tests/test_tile_reduce.py +24 -18
  116. warp/tests/test_tile_shared_memory.py +66 -17
  117. warp/tests/test_tile_view.py +165 -0
  118. warp/tests/test_torch.py +35 -0
  119. warp/tests/test_utils.py +36 -24
  120. warp/tests/test_vec.py +110 -0
  121. warp/tests/unittest_suites.py +29 -4
  122. warp/tests/unittest_utils.py +30 -13
  123. warp/thirdparty/unittest_parallel.py +2 -2
  124. warp/types.py +411 -101
  125. warp/utils.py +10 -7
  126. {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/METADATA +92 -69
  127. {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/RECORD +130 -119
  128. {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/WHEEL +1 -1
  129. warp/examples/benchmarks/benchmark_tile.py +0 -179
  130. warp/native/tile_gemm.h +0 -341
  131. {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/LICENSE.md +0 -0
  132. {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/top_level.txt +0 -0
@@ -167,7 +167,8 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
167
167
  from warp.tests.test_rounding import TestRounding
168
168
  from warp.tests.test_runlength_encode import TestRunlengthEncode
169
169
  from warp.tests.test_scalar_ops import TestScalarOps
170
- from warp.tests.test_sim_grad import TestSimGradients
170
+
171
+ # from warp.tests.test_sim_grad import TestSimGradients Disabled, flaky
171
172
  from warp.tests.test_sim_kinematics import TestSimKinematics
172
173
  from warp.tests.test_smoothstep import TestSmoothstep
173
174
  from warp.tests.test_snippet import TestSnippets
@@ -276,7 +277,7 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
276
277
  TestRounding,
277
278
  TestRunlengthEncode,
278
279
  TestScalarOps,
279
- TestSimGradients,
280
+ # TestSimGradients, Disabled, flaky
280
281
  TestSimKinematics,
281
282
  TestSmoothstep,
282
283
  TestSnippets,
@@ -315,15 +316,18 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
315
316
  """
316
317
  from warp.tests.test_array import TestArray
317
318
  from warp.tests.test_array_reduce import TestArrayReduce
319
+ from warp.tests.test_bool import TestBool
320
+ from warp.tests.test_builtins_resolution import TestBuiltinsResolution
318
321
  from warp.tests.test_bvh import TestBvh
319
322
  from warp.tests.test_codegen import TestCodeGen
320
- from warp.tests.test_codegen_instancing import TestCodeGenInstancing
321
323
  from warp.tests.test_compile_consts import TestConstants
322
324
  from warp.tests.test_conditional import TestConditional
325
+ from warp.tests.test_copy import TestCopy
323
326
  from warp.tests.test_ctypes import TestCTypes
324
327
  from warp.tests.test_devices import TestDevices
325
328
  from warp.tests.test_dlpack import TestDLPack
326
329
  from warp.tests.test_fabricarray import TestFabricArray
330
+ from warp.tests.test_fp16 import TestFp16
327
331
  from warp.tests.test_func import TestFunc
328
332
  from warp.tests.test_generics import TestGenerics
329
333
  from warp.tests.test_grad_customs import TestGradCustoms
@@ -331,26 +335,35 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
331
335
  from warp.tests.test_hash_grid import TestHashGrid
332
336
  from warp.tests.test_indexedarray import TestIndexedArray
333
337
  from warp.tests.test_launch import TestLaunch
338
+ from warp.tests.test_lvalue import TestLValue
334
339
  from warp.tests.test_marching_cubes import TestMarchingCubes
335
340
  from warp.tests.test_mat_lite import TestMatLite
336
341
  from warp.tests.test_math import TestMath
337
342
  from warp.tests.test_matmul_lite import TestMatmulLite
343
+ from warp.tests.test_mempool import TestMempool
338
344
  from warp.tests.test_mesh import TestMesh
339
345
  from warp.tests.test_mesh_query_aabb import TestMeshQueryAABBMethods
340
346
  from warp.tests.test_mesh_query_point import TestMeshQueryPoint
341
347
  from warp.tests.test_mesh_query_ray import TestMeshQueryRay
348
+ from warp.tests.test_mlp import TestMLP
342
349
  from warp.tests.test_module_hashing import TestModuleHashing
343
350
  from warp.tests.test_modules_lite import TestModuleLite
344
351
  from warp.tests.test_noise import TestNoise
345
352
  from warp.tests.test_operators import TestOperators
353
+ from warp.tests.test_peer import TestPeer
354
+ from warp.tests.test_pinned import TestPinned
346
355
  from warp.tests.test_quat import TestQuat
347
356
  from warp.tests.test_rand import TestRand
357
+ from warp.tests.test_reload import TestReload
348
358
  from warp.tests.test_rounding import TestRounding
349
359
  from warp.tests.test_runlength_encode import TestRunlengthEncode
360
+ from warp.tests.test_scalar_ops import TestScalarOps
361
+ from warp.tests.test_snippet import TestSnippets
350
362
  from warp.tests.test_sparse import TestSparse
351
363
  from warp.tests.test_static import TestStatic
352
364
  from warp.tests.test_streams import TestStreams
353
365
  from warp.tests.test_tape import TestTape
366
+ from warp.tests.test_tile_reduce import TestTileReduce
354
367
  from warp.tests.test_transient_module import TestTransientModule
355
368
  from warp.tests.test_types import TestTypes
356
369
  from warp.tests.test_utils import TestUtils
@@ -361,15 +374,18 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
361
374
  test_classes = [
362
375
  TestArray,
363
376
  TestArrayReduce,
377
+ TestBool,
378
+ TestBuiltinsResolution,
364
379
  TestBvh,
365
380
  TestCodeGen,
366
- TestCodeGenInstancing,
367
381
  TestConstants,
368
382
  TestConditional,
383
+ TestCopy,
369
384
  TestCTypes,
370
385
  TestDevices,
371
386
  TestDLPack,
372
387
  TestFabricArray,
388
+ TestFp16,
373
389
  TestFunc,
374
390
  TestGenerics,
375
391
  TestGradCustoms,
@@ -377,26 +393,35 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
377
393
  TestHashGrid,
378
394
  TestIndexedArray,
379
395
  TestLaunch,
396
+ TestLValue,
380
397
  TestMarchingCubes,
381
398
  TestMatLite,
382
399
  TestMath,
383
400
  TestMatmulLite,
401
+ TestMempool,
384
402
  TestMesh,
385
403
  TestMeshQueryAABBMethods,
386
404
  TestMeshQueryPoint,
387
405
  TestMeshQueryRay,
406
+ TestMLP,
388
407
  TestModuleHashing,
389
408
  TestModuleLite,
390
409
  TestNoise,
391
410
  TestOperators,
411
+ TestPeer,
412
+ TestPinned,
392
413
  TestQuat,
393
414
  TestRand,
415
+ TestReload,
394
416
  TestRounding,
395
417
  TestRunlengthEncode,
418
+ TestScalarOps,
419
+ TestSnippets,
396
420
  TestSparse,
397
421
  TestStatic,
398
422
  TestStreams,
399
423
  TestTape,
424
+ TestTileReduce,
400
425
  TestTransientModule,
401
426
  TestTypes,
402
427
  TestUtils,
@@ -7,7 +7,7 @@
7
7
 
8
8
  import ctypes
9
9
  import ctypes.util
10
- import importlib
10
+ import importlib.util
11
11
  import os
12
12
  import sys
13
13
  import time
@@ -58,7 +58,6 @@ def get_selected_cuda_test_devices(mode: Optional[str] = None):
58
58
  """
59
59
 
60
60
  if mode is None:
61
- global test_mode
62
61
  mode = test_mode
63
62
 
64
63
  if mode == "basic":
@@ -98,7 +97,6 @@ def get_test_devices(mode: Optional[str] = None):
98
97
  "all": Returns all available devices.
99
98
  """
100
99
  if mode is None:
101
- global test_mode
102
100
  mode = test_mode
103
101
 
104
102
  devices = []
@@ -128,8 +126,13 @@ def get_cuda_test_devices(mode=None):
128
126
  return [d for d in devices if d.is_cuda]
129
127
 
130
128
 
131
- # redirects and captures all stdout output (including from C-libs)
132
- class StdOutCapture:
129
+ class StreamCapture:
130
+ def __init__(self, stream_name):
131
+ self.stream_name = stream_name # 'stdout' or 'stderr'
132
+ self.saved = None
133
+ self.target = None
134
+ self.tempfile = None
135
+
133
136
  def begin(self):
134
137
  # Flush the stream buffers managed by libc.
135
138
  # This is needed at the moment due to Carbonite not flushing the logs
@@ -137,14 +140,15 @@ class StdOutCapture:
137
140
  if LIBC is not None:
138
141
  LIBC.fflush(None)
139
142
 
140
- # save original
141
- self.saved = sys.stdout
143
+ # Get the stream object (sys.stdout or sys.stderr)
144
+ self.saved = getattr(sys, self.stream_name)
142
145
  self.target = os.dup(self.saved.fileno())
143
146
 
144
147
  # create temporary capture stream
145
148
  import io
146
149
  import tempfile
147
150
 
151
+ # Create temporary capture stream
148
152
  self.tempfile = io.TextIOWrapper(
149
153
  tempfile.TemporaryFile(buffering=0),
150
154
  encoding="utf-8",
@@ -153,33 +157,46 @@ class StdOutCapture:
153
157
  write_through=True,
154
158
  )
155
159
 
160
+ # Redirect the stream
156
161
  os.dup2(self.tempfile.fileno(), self.saved.fileno())
157
-
158
- sys.stdout = self.tempfile
162
+ setattr(sys, self.stream_name, self.tempfile)
159
163
 
160
164
  def end(self):
161
165
  # The following sleep doesn't seem to fix the test_print failure on Windows
162
166
  # if sys.platform == "win32":
163
167
  # # Workaround for what seems to be a Windows-specific bug where
164
- # # the output of CUDA's `printf` is not being immediately flushed
165
- # # despite the context synchronisation.
168
+ # # the output of CUDA's printf is not being immediately flushed
169
+ # # despite the context synchronization.
166
170
  # time.sleep(0.01)
167
-
168
171
  if LIBC is not None:
169
172
  LIBC.fflush(None)
170
173
 
174
+ # Restore the original stream
171
175
  os.dup2(self.target, self.saved.fileno())
172
176
  os.close(self.target)
173
177
 
178
+ # Read the captured output
174
179
  self.tempfile.seek(0)
175
180
  res = self.tempfile.buffer.read()
176
181
  self.tempfile.close()
177
182
 
178
- sys.stdout = self.saved
183
+ # Restore the stream object
184
+ setattr(sys, self.stream_name, self.saved)
179
185
 
180
186
  return str(res.decode("utf-8"))
181
187
 
182
188
 
189
+ # Subclasses for specific streams
190
+ class StdErrCapture(StreamCapture):
191
+ def __init__(self):
192
+ super().__init__("stderr")
193
+
194
+
195
+ class StdOutCapture(StreamCapture):
196
+ def __init__(self):
197
+ super().__init__("stdout")
198
+
199
+
183
200
  class CheckOutput:
184
201
  def __init__(self, test):
185
202
  self.test = test
@@ -306,9 +306,9 @@ def main(argv=None):
306
306
 
307
307
  # Test report
308
308
  print(unittest.TextTestResult.separator2, file=sys.stderr)
309
- print(f'Ran {tests_run} {"tests" if tests_run > 1 else "test"} in {test_duration:.3f}s', file=sys.stderr)
309
+ print(f"Ran {tests_run} {'tests' if tests_run > 1 else 'test'} in {test_duration:.3f}s", file=sys.stderr)
310
310
  print(file=sys.stderr)
311
- print(f'{"OK" if is_success else "FAILED"}{" (" + ", ".join(infos) + ")" if infos else ""}', file=sys.stderr)
311
+ print(f"{'OK' if is_success else 'FAILED'}{' (' + ', '.join(infos) + ')' if infos else ''}", file=sys.stderr)
312
312
 
313
313
  if test_records and args.junit_report_xml:
314
314
  # NVIDIA modification to report results in Junit XML format