NVIDIAGameWorks/kaolin

Import Time Increase from Kaolin 0.16 Due to Warp Initialization

Opened this issue · 0 comments

Description:
Starting with Kaolin 0.16, importing Kaolin functions unrelated to the physics module triggers Warp initialization, resulting in increased import time.

Steps to Reproduce:

  1. Install Kaolin 0.16.
  2. Import any Kaolin module unrelated to the physics functionality.
  3. Observe the increased import time compared to previous versions.

Cause:
The root cause lies in the kaolin/__init__.py file, where from . import physics is invoked. This cascades into:

  • from . import simplicits
  • from .losses_warp import *

The final step initializes Warp:

Expected Behavior:
Kaolin modules unrelated to physics should not trigger Warp initialization, allowing for faster import times.

Proposed Solution:
Defer Warp initialization until it is explicitly needed, such as during the first call to a physics function. This ensures that importing Kaolin functions unrelated to Warp remains efficient, as was the case in versions prior to 0.16.

Additional Notes:
This change will improve the usability of Kaolin for non-physics applications, maintaining consistency with the behavior of earlier versions.