Skip to content

Commit

Permalink
add frontend folder
Browse files Browse the repository at this point in the history
  • Loading branch information
AditiR-42 committed Nov 16, 2023
1 parent fade749 commit 95e04d5
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sims/AstraSim/frontend/Astra-Sim Parameters - INPUT FORMAT (1).csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Network,,
Parameter,Range,SamePerDimension
num-npus,"[8, 16, 32, 64, 128, 256, 512, 1024]",N/A
num-dims,"(1, 4, 1)",N/A
topology,"[{""Ring"", ""Switch"", ""FullyConnected""}]",TRUE
npus_count,"[(1, num-npus, 1)]",FALSE
bandwidth,"[5, 12.5, 25, 50, 100, 200]",FALSE
latency,[{1}],TRUE
,,
System,,
Parameter,Range,SamePerDimension
scheduling-policy,"{""FIFO"", ""LIFO""}",N/A
endpoint-delay,"(1, 1000, 1)",N/A
active-chunks-per-dimension,"(1, 32, 1)",N/A
preferred-dataset-splits,"(1, 1024, 1)",N/A
all-reduce-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE
all-gather-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE
reduce-scatter-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE
all-to-all-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE
collective-optimization,"{""localBWAware"", ""baseline""}",N/A
intra-dimension-scheduling,"{""FIFO"", ""SCF""}",N/A
inter-dimension-scheduling,"{""baseline"", ""themis""}",N/A
,,
Workload,,
Parameter,Range,SamePerDimension
parallel-strategy,"{""dp"", ""fdsp"", ""mpdp""}",N/A
data-parallel-degree,"[1, 2, 4, 8, 16, 32, 64, 128, 256, 512]",N/A
model-parallel-degree,"[1, 2, 4, 8, 16, 32, 64, 128, 256, 512]",N/A
22 changes: 22 additions & 0 deletions sims/AstraSim/frontend/parameter_specs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Network,,,,
Parameter,Range,SamePerDimension,,
num-npus,"[8, 16, 32, 64, 128, 256, 512, 1024]",N/A,,
num-dims,"(1, 4, 1)",N/A,,"(min, max, step)"
topology,"[{""Ring"", ""Switch"", ""FullyConnected""}]",TRUE,,"[ring, ring, ring]"
npus_count,"[(1, num-npus, 1)]",FALSE,,
bandwidth,"[5, 12.5, 25, 50, 100, 200]",FALSE,,"[5, 25, 50]"
latency,[{1}],TRUE,,
,,,,
System,,,,
Parameter,Range,SamePerDimension,,
scheduling-policy,"{""FIFO"", ""LIFO""}",N/A,,
endpoint-delay,"(1, 1000, 1)",N/A,,
active-chunks-per-dimension,"(1, 32, 1)",N/A,,
preferred-dataset-splits,"(1, 1024, 1)",N/A,,
all-reduce-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE,,
all-gather-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE,,
reduce-scatter-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE,,
all-to-all-implementation,"[{""ring"", ""direct"", ""oneRing"", ""oneDirect"", ""hierarchicalRing"", ""doubleBinaryTree""}]",FALSE,,
collective-optimization,"{""localBWAware"", ""baseline""}",N/A,,
intra-dimension-scheduling,"{""FIFO"", ""SCF""}",N/A,,
inter-dimension-scheduling,"{""baseline"", ""themis""}",N/A,,
47 changes: 47 additions & 0 deletions sims/AstraSim/frontend/parse_parameter_specs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import csv
import os

def parse_csv_to_knobs(input_csv):
system_knobs = {}
network_knobs = {}
workload_knobs = {}

current_knob_dict = None

with open(input_csv, 'r') as csvfile:
csvreader = csv.reader(csvfile)

for row in csvreader:
if row and row[0] == 'System':
current_knob_dict = system_knobs
elif row and row[0] == 'Network':
current_knob_dict = network_knobs
elif row and row[0] == 'Workload':
current_knob_dict = workload_knobs
elif row[0] == 'Parameter':
next(csvreader)
elif current_knob_dict is not None:
parameter = row[0]
# row[1] is a set or a tuple. Tuple is a range, and set is a set of possible values
range = row[1]
samePerDimension = row[2]
current_knob_dict[parameter] = (eval(range), samePerDimension)

return system_knobs, network_knobs

# Example usage
input_csv_file = 'parameter_specs.csv'

settings_file_path = os.path.realpath(__file__)
settings_dir_path = os.path.dirname(settings_file_path)
proj_root_path = os.path.abspath(settings_dir_path)

parameter_specs = os.path.join(proj_root_path, input_csv_file)


SYSTEM_KNOBS, NETWORK_KNOBS = parse_csv_to_knobs(parameter_specs)

print("SYSTEM_KNOBS:")
print(SYSTEM_KNOBS)
print("\nNETWORK_KNOBS:")
print(NETWORK_KNOBS)

0 comments on commit 95e04d5

Please sign in to comment.