ジョブの操作

ジョブの問い合わせ

To programmatically get the list of job summaries, use get_job_summaries().

import qai_hub as hub

client = hub.Client()
job_summaries = client.get_job_summaries(limit=10)
print(job_summaries)

Given a specific job ID from the UI (an ID starting with j e.g. jvgdwk7z5), the job can be programmatically queried using get_job().

job = client.get_job("jvgdwk7z5")
print(job)

プロファイルジョブ

プロファイルジョブの結果は、次のように ProfileJob を使用してプログラムで取得できます:

profile = job.download_profile()
print(profile)

印刷された辞書の出力は次のようになります:

{
    'estimated_inference_time': 2997,
    'estimated_inference_peak_memory': 69177344,
    'first_load_time': 2162619,
    'first_load_peak_memory': 83742720,
    'warm_load_time': 123904,
    'warm_load_peak_memory': 73179136,
    'compile_time': 0,
    'compile_peak_memory': 0,
    'compile_memory_increase_range': None,
    'compile_memory_peak_range': None,
    'first_load_memory_increase_range': (0, 0),
    'first_load_memory_peak_range': (26226688, 31730736),
    'warm_load_memory_increase_range': (0, 10580480),
    'warm_load_memory_peak_range': (12865536, 37318656),
    'inference_memory_increase_range': (0, 12160),
    'inference_memory_peak_range': (12288, 21276192),
    'all_compile_times': [],
    'all_first_load_times': [2162619],
    'all_warm_load_times': [123904],
    'all_inference_times': [9130, .... ]
}

メモリはバイト単位で、時間はマイクロ秒単位で表されます。レイテンシをミリ秒で取得するには:

latency_ms = profile["execution_summary"]["execution_time"] / 1000

Downloading Job Artifacts

Jobs produce artifacts during execution. Depending on the job type, artifacts can include server logs, device logs, op-by-op timing summaries, or QNN HTP Analysis Summaries (QHAS). These are useful for troubleshooting job failures or understanding job behavior.

To see which artifacts are available for a completed job:

artifacts = job.get_available_artifacts()
print(artifacts)
# e.g. [<JobArtifactType.HUB_LOG: 5>, <JobArtifactType.DEVICE_LOG: 1>]

To download a specific artifact type:

paths = job.download_artifacts_for_type("./artifacts", hub.JobArtifactType.HUB_LOG)

To download all available logs (device log and hub log):

paths = job.download_job_logs("./artifacts")

Logs are also automatically included when calling download_results:

results = job.download_results("./results")
# results directory will contain the job's primary output (e.g. compiled model)
# as well as any available log files

Available artifact types are listed in JobArtifactType. Not all types are available for all jobs — use get_available_artifacts() to check what is available for a specific job.

注釈

The format, content, and availability of job artifacts may change without notice. They are not part of the stable API contract.

ジョブの共有

デフォルトでは、すべてのジョブはジョブを作成したユーザーのみがアクセスできます。ジョブは次の方法で特定のアカウントとプログラムで共有することもできます:

job.modify_sharing(add_emails=['name@company.com'])

特定のアカウントからの権限を取り消すこともできます:

job.modify_sharing(delete_emails=['name@company.com'])