Files
mscclpp/python/mscclpp/language/general.py
Binyang Li 5acac93dbc Integrate MSCCL++ DSL to torch workload (#620)
Provides two integration ways for MSCCL++ DSL.
1. Integrate with customized communication group
2. Integrate with NCCL API

Introduce new Python APIs to make it work:
```python
mscclpp.compile # compile dsl to json based execution plan
mscclpp.ExecutionPlanRegistry.register_plan(plan) # register the compiled plan to executionPlanRegistery
mscclpp.ExecutionPlanRegistry.set_selector(selector) # set the selector, the selector will return the best execution plan based on collection, message size, world size....
```
Fix #556

---------

Co-authored-by: Caio Rocha <caiorocha@microsoft.com>
Co-authored-by: Changho Hwang <changhohwang@microsoft.com>
2025-10-29 15:39:00 -07:00

20 lines
655 B
Python

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from mscclpp.language.internal.globals import get_program
def JSON():
"""Convert the current MSCCL++ program to JSON format.
This function post-processes all operations in the current program and
returns the program representation as a JSON string. This is typically
called after defining a complete communication program to serialize it
for execution.
Returns:
str: A JSON string representation of the current MSCCL++ program,
including all ranks, operations, channels, and configuration.
"""
return get_program().to_json()