AI Foundry Sweep Job

The AI Foundry Sweep Job job type submits an Azure Machine Learning Sweep job (hyperparameter sweep over a trial command) in an Azure AI Foundry workspace. The template Sweep Job is identified by its job name — Polysync stores that in the External Id.

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

Required job fields

  • External Id — the template Sweep Job name.
  • Job TypeAI Foundry Sweep Job (set automatically on import).

Required / optional job attributes:

  • AI Foundry Compute Name — overrides properties.computeId.
  • AI Foundry Environment Name — overrides properties.trial.environmentId.
  • AI Foundry Command — overrides properties.trial.command.
  • AI Foundry Objective Metricproperties.objective.primaryMetric (e.g., accuracy).
  • AI Foundry Objective Goalproperties.objective.goal (maximize / minimize).

Job discovery

GET /jobs?api-version=2024-10-01&$filter=jobType eq 'Sweep'&$top=100

Parameter handling

Input parameters are mapped into the sweep's search space — each becomes a choice over [value]:

{
  "properties": {
    "jobType": "Sweep",
    "displayName": "<polysync-name>",
    "computeId": "<from-attr-or-template>",
    "trial": {
      "command": "<from-attr-or-template>",
      "environmentId": "<from-attr-or-template>"
    },
    "objective": {
      "primaryMetric": "<AI Foundry Objective Metric>",
      "goal": "<AI Foundry Objective Goal>"
    },
    "samplingAlgorithm": { "samplingAlgorithmType": "Random" },
    "limits": { "maxTotalTrials": 10, "maxConcurrentTrials": 2 },
    "searchSpace": {
      "<name>": { "type": "choice", "values": [<typed-value>] }
    }
  }
}
Direction Sent in searchSpace Updated from properties.outputs
Input
Output
Input&Output

Polysync currently submits only Random sampling with maxTotalTrials = 10 / maxConcurrentTrials = 2 and wraps each input as a one-element choice — to use richer distributions (uniform, loguniform, multi-value choices), edit the template Sweep Job in AI Foundry and use its definition unchanged.

Execution flow

Identical to AI Foundry Pipeline Job:

  1. PUT /jobs/{newJobName} with the Sweep body.
  2. Status polled via GET /jobs/{runId} — same Azure ML mapping table.
  3. Cancel via POST /jobs/{runId}/cancel.

Monitor URL

Same as AI Foundry Pipeline Jobhttps://ml.azure.com/runs/{runId}?wsid=…. The sweep landing page shows trial-by-trial metrics.

Best practices

  • Set the objective metric exactly as your training script logs it (mlflow.log_metric("accuracy", …) → use accuracy).
  • Start with a small maxTotalTrials budget and grow once the Pipeline / Command form of the job is proven.

Troubleshooting

  • No trials completed — every trial failed; open the Monitor URL to inspect a single trial's logs.
  • PrimaryMetricNotFound — the metric name does not match what the trial logs; align the AI Foundry Objective Metric job attribute with the actual MLflow / AzureML metric key.