Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Performance when multiple agents exist

Discussion in 'ML-Agents' started by kokimitsunami, Jun 1, 2022.

  1. kokimitsunami

    kokimitsunami

    Joined:
    Sep 2, 2021
    Posts:
    25
    Hi,

    I am experimenting to see how it performs when there are multiple agents in a game.

    Currently, there are two agents, both of which act with the same NN structure model. The processing time and the behavior on the profiler are different when both are given a model with the same weights and when each is given a model with a different weights (see the attached images). I am looking at the AcademyFixedUpdateStepper.FixedUpdate function as the agent processing time. Also, the times taken by the root.DecideAction function and the root.AgentAct function, in the Academy, are very different between the two cases.
    MultiAgents_DiffNN.png MultiAgents_SameNN.png

    What do DecideAction and AgentAct functions do respectively? Also, How does it work when there are multiple agents (with same network and with different networks)? How do they change when the number of agents increases?

    Thanks
     
  2. kokimitsunami

    kokimitsunami

    Joined:
    Sep 2, 2021
    Posts:
    25
    Does anyone have any idea on this? I appreciate if if you could provide any pointers.
     
  3. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    114
    I know its old thread.

    But I've the same issue with 8 agents 4vs4 game, root.DecideAction take too much time to compute, and since the game is webgl its even slower since everything is single threaded.

    Yet, one from unity dev team suggested that num_layers & hidden_units paramaters for the training configuration playing strong part effecting the performance for decision making

    So less num_layers and less hidden_units the better performance it would be.