diff --git a/sims/AstraSim/frontend/Astra-Sim Parameters - INPUT FORMAT (1).csv b/sims/AstraSim/frontend/Astra-Sim Parameters - INPUT FORMAT (1).csv new file mode 100644 index 00000000..bcb7a9a8 --- /dev/null +++ b/sims/AstraSim/frontend/Astra-Sim Parameters - INPUT FORMAT (1).csv @@ -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 \ No newline at end of file diff --git a/sims/AstraSim/frontend/parameter_specs.csv b/sims/AstraSim/frontend/parameter_specs.csv new file mode 100644 index 00000000..7c16d18a --- /dev/null +++ b/sims/AstraSim/frontend/parameter_specs.csv @@ -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,, \ No newline at end of file diff --git a/sims/AstraSim/frontend/parse_parameter_specs.py b/sims/AstraSim/frontend/parse_parameter_specs.py new file mode 100644 index 00000000..c88fdb75 --- /dev/null +++ b/sims/AstraSim/frontend/parse_parameter_specs.py @@ -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) \ No newline at end of file