Spaces:
Running
Running
Fix device order.
Browse files- src/visualizer.py +4 -1
src/visualizer.py
CHANGED
|
@@ -243,7 +243,10 @@ def create_pipeline_figure(schedule_data: Dict[int, List[Dict]], max_time=None,
|
|
| 243 |
|
| 244 |
# Set axis properties
|
| 245 |
device_labels = [f"Device {i}" for i in range(num_devices)]
|
| 246 |
-
|
|
|
|
|
|
|
|
|
|
| 247 |
|
| 248 |
# Calculate tick positions with no gaps
|
| 249 |
tick_positions = [(num_devices - i - 1) * y_spacing for i in range(num_devices)]
|
|
|
|
| 243 |
|
| 244 |
# Set axis properties
|
| 245 |
device_labels = [f"Device {i}" for i in range(num_devices)]
|
| 246 |
+
# Modify the ordering to put Device 1 at the top, then Device 0, then the rest
|
| 247 |
+
if num_devices >= 2:
|
| 248 |
+
# Move Device 1 to the top, followed by Device 0
|
| 249 |
+
device_labels = [device_labels[1], device_labels[0]] + device_labels[2:] if num_devices > 1 else device_labels
|
| 250 |
|
| 251 |
# Calculate tick positions with no gaps
|
| 252 |
tick_positions = [(num_devices - i - 1) * y_spacing for i in range(num_devices)]
|