Victarry commited on
Commit
8402d37
·
1 Parent(s): d3e7e66
Files changed (2) hide show
  1. README.md +1 -1
  2. src/visualizer.py +10 -31
README.md CHANGED
@@ -59,7 +59,7 @@ uv run python main.py strategy=1f1b_overlap num_devices=4 num_stages=4 num_batch
59
 
60
  Running for 1F1B-interleave-overlap strategy:
61
  ```bash
62
- uv run python main.py strategy=1f1b_interleave_overlap num_devices=4 num_stages=4 num_batches=8
63
  ```
64
  ![1f1b_interleave_overlap](assets/1f1b_interleave_overlap.png)
65
 
 
59
 
60
  Running for 1F1B-interleave-overlap strategy:
61
  ```bash
62
+ uv run python main.py strategy=1f1b_interleave_overlap num_devices=4 num_stages=8 num_batches=8
63
  ```
64
  ![1f1b_interleave_overlap](assets/1f1b_interleave_overlap.png)
65
 
src/visualizer.py CHANGED
@@ -72,30 +72,26 @@ def convert_schedule_to_visualization_format(schedule: Schedule):
72
  def get_color(op_type: str, stage_id: int, num_devices: int):
73
  # A more harmonious blue palette with better progression for forward operations
74
  forward_colors = [
75
- "#5c88f2", # Periwinkle blue
76
  "#1a53ff", # Deep blue
77
- "#b3c6ff", # Light blue
78
  "#4d79ff", # Strong blue
79
- "#809fff", # Medium blue
80
- "#0039e6", # Rich navy
81
- "#002db3", # Dark navy
82
- "#264db3", # Royal blue
83
  "#7094db", # Steel blue
 
84
  "#99b3e6", # Pale blue
 
85
  ]
86
 
87
  # Orange palette for backward operations
88
  backward_colors = [
89
- "#ff9933", # Bright orange
 
90
  "#ffad5c", # Medium orange
91
  "#ffc285", # Light orange
92
- "#ffd6ad", # Pale orange
93
- "#ff8000", # Deep orange
94
- "#cc6600", # Dark orange
95
- "#ff9933", # Vivid orange
96
- "#ffb366", # Soft orange
97
- "#cc9966", # Muted orange
98
  "#ffd699", # Light amber
 
 
 
99
  ]
100
 
101
  # Improved teal/turquoise palette with better progression for backward_D operations
@@ -126,29 +122,12 @@ def get_color(op_type: str, stage_id: int, num_devices: int):
126
  "#c6e6c6", # Pastel green
127
  ]
128
 
129
- # Purple palette for overlapped operations
130
- overlapped_colors = [
131
- "#9966cc", # Medium purple
132
- "#8a2be2", # Blue violet
133
- "#9370db", # Medium purple
134
- "#6a5acd", # Slate blue
135
- "#7b68ee", # Medium slate blue
136
- "#ba55d3", # Medium orchid
137
- "#9932cc", # Dark orchid
138
- "#d8bfd8", # Thistle
139
- "#e6e6fa", # Lavender
140
- "#dda0dd", # Plum
141
- ]
142
-
143
  virtual_stage = stage_id // num_devices
144
 
145
  # If virtual_stage is beyond our color list, cycle through the colors
146
  color_index = virtual_stage % len(forward_colors)
147
 
148
- # Handle overlapped operations
149
- if op_type.startswith("overlapped_"):
150
- return overlapped_colors[color_index]
151
- elif op_type == "forward":
152
  return forward_colors[color_index]
153
  elif op_type == "backward":
154
  return backward_colors[color_index]
 
72
  def get_color(op_type: str, stage_id: int, num_devices: int):
73
  # A more harmonious blue palette with better progression for forward operations
74
  forward_colors = [
75
+ "#0039e6", # Rich navy
76
  "#1a53ff", # Deep blue
 
77
  "#4d79ff", # Strong blue
78
+ "#5c88f2", # Periwinkle blue
 
 
 
79
  "#7094db", # Steel blue
80
+ "#809fff", # Medium blue
81
  "#99b3e6", # Pale blue
82
+ "#b3c6ff", # Light blue
83
  ]
84
 
85
  # Orange palette for backward operations
86
  backward_colors = [
87
+ "#ff8000", # Deep orange
88
+ "#ff9933", # Strong orange
89
  "#ffad5c", # Medium orange
90
  "#ffc285", # Light orange
 
 
 
 
 
 
91
  "#ffd699", # Light amber
92
+ "#ffd6ad", # Pale orange
93
+ "#ffe0c2", # Very pale orange
94
+ "#fff0e0", # Lightest orange
95
  ]
96
 
97
  # Improved teal/turquoise palette with better progression for backward_D operations
 
122
  "#c6e6c6", # Pastel green
123
  ]
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  virtual_stage = stage_id // num_devices
126
 
127
  # If virtual_stage is beyond our color list, cycle through the colors
128
  color_index = virtual_stage % len(forward_colors)
129
 
130
+ if op_type == "forward":
 
 
 
131
  return forward_colors[color_index]
132
  elif op_type == "backward":
133
  return backward_colors[color_index]