Advanced Usage¶
Leveraging the information obtained from the response data can significantly enhance your use of Amplify AE. This section details advanced techniques for utilizing Amplify AE.
Obtaining Execution Time Information¶
After receiving a solving request from the user, Amplify AE executes the following steps and returns the results.
Request Data Parsing
Parses the userâs solve request and extracts necessary information from the JSON data.
Resource Allocation
Reserves available GPU resources for the user and prepares the environment for computation.
GPU-Based Solving
Executes an optimization algorithm based on the simulated annealing method.
Result Analysis and Return
Transfers computation results to host memory and returns the optimal solution, along with evaluation results for objective functions and constraints.
The diagram above illustrates the solver execution timing as envisioned by the Amplify SDK. Amplify AE operates according to this diagram.
The time from âReceive Requestâ to âStart Executionâ corresponds to the processing time for steps 1 and 2 above. The time from âStart Executionâ to âEnd Executionâ corresponds to step 3, and the time from âEnd Executionâ to âSend Responseâ corresponds to step 4.
The time_limit_ms parameter in the request data specifies the time for step 3, but achiving exact adherence can be difficult, and the specified time may be slightly exceeded. Therefore, the actual processing time is recorded in the execution_time_ms field of the response data. Additionally, the waiting time for step 2 can be obtained from the queue_time_ms field in the response data.
The timing information included in the response data is summarized below.
|
GPU solving time (in milliseconds) |
|
Waiting time in the resource allocation queue (step 2) (in milliseconds) |
|
Timestamp when the request was received (time of âReceive Requestâ) |
|
Timestamp when GPU processing started (start time of step 3) |
See also
For information on obtaining timing information using the Amplify SDK, refer to the Client Page.
During the period from âStart Executionâ to âEnd Executionâ in step 4, Amplify AE runs the optimization algorithm. It records the solution obtained and its execution times each time the best solution is updated. This provides the user with a history of the explored solutions. The acquisition timestamp for each solution is recorded in the time_stamp_ms field within the array elements of the solutions field. This timestamp represents the elapsed time since the start of step 3 (started_at). This information enables users to track the exploration progress. For an example of analyzing execution time using the Amplify SDK, refer to Execution Time information.
Obtaining Solve Information¶
During the âExecution Timeâ in the above solve process, detailed information about the number of solving iterations performed by Amplify AE is recorded in the response data.
During the solving phase, Amplify AE creates the next state from the current state (a combination of variable values) using a specified number of GPUs based on the annealing method. This operation is called a âflipâ. The GPU performs a predetermined number of flips based on the solving situation and returns the best solution obtained to the CPU. This is called âsamplingâ. If the solution obtained through sampling is better than the previously known best solution, the known best solution is updated. This series of operations is performed until the specified time is reached, and the results are returned to the user as a history of solution updates.
During the above solving process, Amplify AE records the following information in the response data.
|
Number of GPUs used for solving |
|
Total number of flips attempted by all GPUs until the execution result is returned |
|
Number of solutions obtained (number of samplings) until returning the execution result is returned |
|
Version of Amplify AE and GPU name |
See also
For information on obtaining solving information with the Amplify SDK, refer to the Client Page.
Retrieving Duplicate Solutions¶
When multiple solutions with the same objective function value exist, Amplify AE defaults to recording only the first solution found. This is because the process of updating the known best solution is only updated when a better solution is found.
To change this behavior and retrieve all discovered duplicate solutions, set the duplicate_solutions parameter in the request data to true. This will record all solutions with different variable combinations but the same objective function value and return them in the array included in the solutions field of the response data.
Note
Note that the retrieval of all duplicate solutions is not assured. Amplify AEâs exploration algorithm is probabilistic, and even if multiple solutions with the same objective function value exist, all solutions are not guaranteed to be found.
See also
For information on obtaining duplicate solutions using the Amplify SDK, refer to the Client Page.