FredericoMetelo / peersim-environment

12 stars 0 forks source link

RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x24 and 22x512) #5

Open zhengluohu opened 3 months ago

zhengluohu commented 3 months ago

Hello, I encountered the following error while setting up my environment:

image

My parameter settings are as follows:

 POSITIONS = "18.55895350495783,17.02475796027715;47.56499372388999,57.28732691557995;5.366872150976409,43.28729893321355;17.488160666668694,29.422819514162434;81.56549175388358,53.14564532018814;85.15660881172089,74.47408014762478;18.438454887921974,44.310130148722195;72.04311826903107,62.06952644109185;25.60125368295145,15.54795598202745;17.543669122835837,70.7258178169151"
    TOPOLOGY = "0,2,3,6,8;1,2,3,4,5,6,7,8,9;2,0,1,3,6,8,9;3,0,1,2,6,8,9;4,1,5,7;5,1,4,7;6,0,1,2,3,8,9;7,1,4,5;8,0,1,2,3,6;9,1,2,3,6"
    controllers = ["0","1", "2", "3", "4", "5", "6", "7", "8", "9"]  # , "5" only one for now...
    config_dict = ch.generate_config_dict(lambda_task_arrival_rate=0.8,
                                          controllers=controllers,
                                          # Simulation Parameters
                                          size=10,
                                          simulation_time=1000, 
                                          frequency_of_action=5,
                                          has_cloud=1, 
                                          cloud_VM_processing_power=[1e8], 

                                          nodes_per_layer=[1, 1, 8], 
                                          cloud_access=[1, 1, 1], 
                                          freqs_per_layer=[4e7, 2e6, 2e6],
                                          no_cores_per_layer=[1, 1, 1], 
                                          q_max_per_layer=[8, 8, 8],
                                          variations_per_layer=[1e3, 1e3, 1e3], 
                                          layersThatGetTasks=[0, 1, 2], 
                                          clientLayers=[0, 1, 2],
                                          channelTypes="PeersimSimulator.peersim.env.Transport.OpticalFiberSNR;PeersimSimulator.peersim.env.Transport.WirelessSNR",
                                          channelTypesBetweenLayers="0,0,1;0,0,1;1,1,1",

                                          task_probs=[1], 
                                          task_sizes=[50], 
                                          task_instr=[32e7], 
                                          task_CPI=[1], 
                                          task_deadlines=[100], 
                                          target_time_for_occupancy=0.5, 

                                          comm_B=2, 
                                          comm_Beta1=0.001, 
                                          comm_Beta2=4, 
                                          comm_Power=20, 

                                          weight_utility=10,

                                          weight_delay={"exec": 2, "comm": 3, "queue": 1, "global": 1},
                                          weight_overload=2,
                                          RANDOMIZETOPOLOGY=False,
                                          RANDOMIZEPOSITIONS=False,
                                          POSITIONS="15.55895350495783,17.02475796027715;47.56499372388999,57.28732691557995;5.366872150976409,43.28729893321355;17.488160666668694,29.422819514162434;81.56549175388358,53.14564532018814;85.15660881172089,74.47408014762478;18.438454887921974,44.310130148722195;72.04311826903107,62.06952644109185;25.60125368295145,15.54795598202745;17.543669122835837,70.7258178169151",
                                          TOPOLOGY="0,1,2,3,6,8;1,0,2,3,4,5,6,7,8,9;2,0,1,3,6,8,9;3,0,1,2,6,8,9;4,1,5,7;5,1,4,7;6,0,1,2,3,8,9;7,1,4,5;8,0,1,2,3,6;9,1,2,3,6",
                                          workloadPath="/root/peersim/peersim-environment/Datasets/alibaba_trace_cleaned.json",
                                          defaultCPUWorkload="2.4e+9",
                                          defaultMemoryWorkload="100",
                                          clientIsSelf=1, 

                                          )

When I link Node 1 to the cloud (cloud_access=[1,1,1]), this error occurs. However, when cloud_access=[1,0,1], this error does not occur. Therefore, I think this error might be related to the topology of Node 1.

For other nodes in the flat_observation function in utils.py, len(flat_Q) = len(flat_free) = 10, but for Node 1, len(flat_Q) = len(flat_free) = 11. This might involve the observation in the Peersim simulator, which I am not very familiar with.

image

I hope to get your help, thank you~

FredericoMetelo commented 3 months ago

Sorry, for not saying anything. I saw your issue yesterday, but unfortunately couldn't answer right away. I'm currently working to fix this problem.