AI Foundry Sweep Job

The AI Foundry Sweep Job job type re-runs an Azure Machine Learning Sweep job (a hyperparameter sweep over a trial command) in an Azure AI Foundry hub / Azure ML workspace. The imported job is a template run, identified by its job name (stored in External Id). Every execution submits a clone of it. The trial (code, environment, command), search space, sampling algorithm, limits, early-termination policy and objective are kept, and the task's values are overlaid on the sweep's inputs.

This job type is supported on the Azure AI Foundry platform.

Required job fields

  • External Id — the template sweep job's name (set on import).
  • Job Type — AI Foundry Sweep Job (set automatically on import).

Optional job settings — imported from the template, sent only as overrides:

  • Compute Name → properties.computeId.
  • Environment Name → properties.trial.environmentId.
  • Command → properties.trial.command.
  • Objective Metric → properties.objective.primaryMetric (e.g. accuracy).
  • Objective Goal → properties.objective.goal (Maximize / Minimize).

Job discovery

GET /jobs?api-version=2026-07-01&jobType=Sweep     (every nextLink page is followed)

Parameter handling

Source on import Polysync parameter Direction
sweep inputs.<name> (literal or data) <name>, default = the template's value / URI Input
MLflow metrics and tags of the template's best trial <key> Output

Input values go to the sweep's inputs, which the trial command references as ${{inputs.<name>}}. They are not search-space dimensions. The search space comes from the template unchanged. To sweep different ranges, edit the template sweep in Azure ML and re-import it.

Execution flow

  1. GET /jobs/{externalId} reads the template. If it is missing, the run fails clearly.
  2. PUT /jobs/polysync-{guid} submits the clone, tagged polysync_template.
  3. Status is polled with GET /jobs/{runId}, using the same status table as the Command Job. Times and failure messages come from the run-history API.
  4. On success, the best trial is read back. That is the trial Azure ML itself recorded as best (best_child_run_id in run history). If that is unavailable, it is the child run with the highest (Maximize) or lowest (Minimize) value of the objective metric. Its MLflow metrics and user tags become the output values, including Azure ML's hyperparameters tag (the winning search-space values). The sweep run's own tags (samples_generated_count, retry_count_…) are Azure ML bookkeeping and are never outputs. Sweep jobs expose no tracking endpoint of their own, so Polysync uses the workspace's MLflow endpoint.
  5. Cancel: POST /jobs/{runId}/cancel.

Monitor URL

Same as the Command Job. The sweep page in Azure ML studio shows trial-by-trial metrics.

Best practices

  • Set the objective metric exactly as the trial script logs it. With mlflow.log_metric("accuracy", …), use accuracy.
  • Start with a small max_total_trials in the template and grow it once the sweep is proven.

Troubleshooting

  • No trials completed — every trial failed. Open the Monitor URL to inspect a trial's logs.
  • Outputs are empty — no trial logged the objective metric, so no best trial could be chosen. Align Objective Metric with the logged key.