constants.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import os
  2. # Reserved keys used to handle ClassMethodNode in Ray DAG building.
  3. PARENT_CLASS_NODE_KEY = "parent_class_node"
  4. PREV_CLASS_METHOD_CALL_KEY = "prev_class_method_call"
  5. BIND_INDEX_KEY = "bind_index"
  6. IS_CLASS_METHOD_OUTPUT_KEY = "is_class_method_output"
  7. # Reserved keys used to handle CollectiveOutputNode in Ray DAG building.
  8. COLLECTIVE_OPERATION_KEY = "collective_operation"
  9. # Reserved key to distinguish DAGNode type and avoid collision with user dict.
  10. DAGNODE_TYPE_KEY = "__dag_node_type__"
  11. # Feature flag to turn off the deadlock detection.
  12. RAY_CGRAPH_ENABLE_DETECT_DEADLOCK = (
  13. os.environ.get("RAY_CGRAPH_ENABLE_DETECT_DEADLOCK", "1") == "1"
  14. )
  15. # Feature flag to turn on profiling.
  16. RAY_CGRAPH_ENABLE_PROFILING = os.environ.get("RAY_CGRAPH_ENABLE_PROFILING", "0") == "1"
  17. # Feature flag to turn on NVTX (NVIDIA Tools Extension Library) profiling.
  18. # With this flag, Compiled Graph uses nvtx to automatically annotate and profile
  19. # function calls during each actor's execution loop.
  20. # This cannot be used together with RAY_CGRAPH_ENABLE_TORCH_PROFILING.
  21. RAY_CGRAPH_ENABLE_NVTX_PROFILING = (
  22. os.environ.get("RAY_CGRAPH_ENABLE_NVTX_PROFILING", "0") == "1"
  23. )
  24. # Feature flag to turn on torch profiling.
  25. # This cannot be used together with RAY_CGRAPH_ENABLE_NVTX_PROFILING.
  26. RAY_CGRAPH_ENABLE_TORCH_PROFILING = (
  27. os.environ.get("RAY_CGRAPH_ENABLE_TORCH_PROFILING", "0") == "1"
  28. )
  29. # Feature flag to turn on visualization of the execution schedule.
  30. RAY_CGRAPH_VISUALIZE_SCHEDULE = (
  31. os.environ.get("RAY_CGRAPH_VISUALIZE_SCHEDULE", "0") == "1"
  32. )