Azure AutoML运行报实体字段超大小限制错误如何调试定位?
报错信息:
A field of the entity is over the size limit. FieldName=RunDto.Properties.Value/Length, Limit=550000, Size=697351
ERROR - AutoML driver_wrapper script terminated with an exception of type: <class 'azureml._restclient.exceptions.ServiceException'>ExceptionTarget: Unspecified 2021-10-05 05:00:02.236 - WARNING - An service error was raised with an HTTP code 400. Error details unavailable. 2021-10-05 05:00:02.236 - WARNING - Encountered an exception of type: <class 'azureml._restclient.exceptions.ServiceException'>, interpreted as error code Service. 2021-10-05 05:00:02.544 - WARNING - An service error was raised with an HTTP code 400. Error details unavailable. 2021-10-05 05:00:02.545 - WARNING - Encountered an exception of type: <class 'azureml._restclient.exceptions.ServiceException'>, interpreted as error code SystemError.ClientError.AutoMLInternal.Service.
该报错为AzureML服务端硬限制触发的客户端错误:AutoML运行过程中写入到运行属性(Run Properties)的总字符数超过了550KB的上限,导致服务端返回400错误终止运行。
- 先排查自定义属性写入逻辑:检查AutoMLStep执行代码中是否有手动调用
run.add_properties()、run.tag()、run.log()等接口写入大体积数据的操作,比如全量特征列清单、数据集完整统计结果、大段训练文本日志这类内容,都会直接累加Properties的总大小。 - 排查AutoML配置项:检查
AutoMLConfig的参数配置,是否将verbosity设置为DEBUG级别允许全量日志上报、是否关闭了早停逻辑导致训练迭代次数过多,每轮迭代的指标全部写入Properties导致总大小超标。 - 本地复现定位异常字段:将AutoMLStep改为本地运行模式,在运行过程中定时调用
run.get_properties()获取所有属性值,统计每个属性的字符长度,即可直接定位到导致超限的具体字段。
- 移除非必要的自定义属性写入逻辑,大体积的日志、统计数据直接写入关联的Blob存储,仅在Properties中留存存储路径即可。
- 将AutoML的
verbosity调整为INFO或WARNING级别,限制日志上报量。 - 开启
enable_early_stopping配置,减少不必要的训练迭代及对应指标上报。
内容的提问来源于stack exchange,提问作者colab123

