Add fp32 resnet50 model for vitisai ep demo#116
Add fp32 resnet50 model for vitisai ep demo#116Json288 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Signed-off-by: Song <jamesong@amd.com>
|
@Json288 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Signed-off-by: Song <jamesong@amd.com>
| url: "webnn/efficientnet-lite4/resolve/main/onnx/model_fp16.onnx", | ||
| path: "./demos/image-classification/models/webnn/efficientnet-lite4/onnx", | ||
| }, | ||
| { |
There was a problem hiding this comment.
I was testing out the changes in this branch, and it looks like I can't fetch the full suite of models (after the seventh one, the npm command exits and doesn't download the remaining ones). Are you seeing anything similar? Example output below.
PS C:\src\webnn-developer-preview-amd> npm run fetch-models
> webnn-developer-preview@1.0.0 fetch-models
> node fetch_models.js
[1/40] Downloading https://huggingface.co/xenova/resnet-50/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\xenova\resnet-50\onnx\model_fp16.onnx
-> downloading [========================================] 100% 0.0s
[1/40] Downloaded https://huggingface.co/xenova/resnet-50/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\xenova\resnet-50\onnx\model_fp16.onnx
[2/40] Downloading https://huggingface.co/webnn/mobilenet-v2/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\mobilenet-v2\onnx\model_fp16.onnx
-> downloading [========================================] 100% 0.0s
[2/40] Downloaded https://huggingface.co/webnn/mobilenet-v2/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\mobilenet-v2\onnx\model_fp16.onnx
[3/40] Downloading https://huggingface.co/webnn/efficientnet-lite4/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\efficientnet-lite4\onnx\model_fp16.onnx
-> downloading [========================================] 100% 0.0s
[3/40] Downloaded https://huggingface.co/webnn/efficientnet-lite4/resolve/main/onnx/model_fp16.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\efficientnet-lite4\onnx\model_fp16.onnx
[4/40] Downloading https://huggingface.co/amd/resnet50/resolve/main/webnn/onnx/model.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\resnet50\onnx\model.onnx
-> downloading [========================================] 100% 0.0s
[4/40] Downloaded https://huggingface.co/amd/resnet50/resolve/main/webnn/onnx/model.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\resnet50\onnx\model.onnx
[5/40] Downloading https://huggingface.co/amd/MobileNetV2/resolve/main/webnn/onnx/model.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\MobileNetV2\onnx\model.onnx
-> downloading [========================================] 100% 0.0s
[5/40] Downloaded https://huggingface.co/amd/MobileNetV2/resolve/main/webnn/onnx/model.onnx to C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\MobileNetV2\onnx\model.onnx
[6/40] Downloading https://huggingface.co/microsoft/sd-turbo-webnn/resolve/main/text_encoder/model_layernorm.onnx to C:\src\webnn-developer-preview-amd\demos\sd-turbo\models\text_encoder\model_layernorm.onnx
-> downloading [========================================] 100% 0.0s
[6/40] Downloaded https://huggingface.co/microsoft/sd-turbo-webnn/resolve/main/text_encoder/model_layernorm.onnx to C:\src\webnn-developer-preview-amd\demos\sd-turbo\models\text_encoder\model_layernorm.onnx
[7/40] Downloading https://huggingface.co/microsoft/sd-turbo-webnn/resolve/main/unet/model_layernorm.onnx to C:\src\webnn-developer-preview-amd\demos\sd-turbo\models\unet\model_layernorm.onnx
PS C:\src\webnn-developer-preview-amd>
There was a problem hiding this comment.
No, I did not see a similar issue with fetch_models.js. And based on the provided log, the amd models added have been downloaded without error. Could you check if amd's models exist in the corresponding folder? And could you also try to run the fetch again to see if the problem persist?
There was a problem hiding this comment.
The new models exist, but I think the problem is that the rest of the models aren't getting downloaded for whatever reason. I'd expect to see ~40 models downloaded. So, I'm not sure if something regressed here, as I don't see this behavior on the main branch of the parent repo.
C:\src\webnn-developer-preview-amd>dir /s /b *.onnx
C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\MobileNetV2\onnx\model.onnx
C:\src\webnn-developer-preview-amd\demos\image-classification\models\amd\resnet50\onnx\model.onnx
C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\efficientnet-lite4\onnx\model_fp16.onnx
C:\src\webnn-developer-preview-amd\demos\image-classification\models\webnn\mobilenet-v2\onnx\model_fp16.onnx
C:\src\webnn-developer-preview-amd\demos\image-classification\models\xenova\resnet-50\onnx\model_fp16.onnx
C:\src\webnn-developer-preview-amd\demos\sd-turbo\models\text_encoder\model_layernorm.onnx
C:\src\webnn-developer-preview-amd\demos\sd-turbo\models\unet\model_layernorm.onnx
There was a problem hiding this comment.
Well, not sure what changed in the previous few hours (I restarted and changed networks in the interim, so maybe something there got things unstuck)- but at the moment, running the script seems to make it past the seventh model (it's downloading number 13 as I write this). We can consider this resolved.
There was a problem hiding this comment.
I jinxed it. It bailed out after the 14th model finished downloading. Trying again. 😢
There was a problem hiding this comment.
Hm, there's some degree of flakiness that I'm observing. At any rate, will treat this as a separate issue. Thanks for confirming behavior on your side.
[26/40] Downloading https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx to C:\src\webnn-developer-preview-amd\demos\segment-anything\models\sam_vit_b_01ec64.encoder-fp16.onnx
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx (2 retries left)
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx (1 retries left)
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx after multiple attempts Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
[27/40] Downloading https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx to C:\src\webnn-developer-preview-amd\demos\segment-anything\models\sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx (2 retries left)
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx (1 retries left)
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx after multiple attempts Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b_01ec64.decoder-orig-img-size-dynamic-fp16.onnx Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
[28/40] Downloading https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-encoder-int8.onnx to C:\src\webnn-developer-preview-amd\demos\segment-anything\models\sam_vit_b-encoder-int8.onnx
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-encoder-int8.onnx (2 retries left)
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-encoder-int8.onnx (1 retries left)
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-encoder-int8.onnx after multiple attempts Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-encoder-int8.onnx Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
[29/40] Downloading https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx to C:\src\webnn-developer-preview-amd\demos\segment-anything\models\sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx (2 retries left)
Retrying download for https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx (1 retries left)
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx after multiple attempts Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
Failed to download https://huggingface.co/webnn/segment-anything-model-webnn/resolve/main/sam_vit_b-decoder-orig-img-size-dynamic-int8.onnx Error: HTTP error! Status: 404 Not Found
at downloadFile (file:///C:/src/webnn-developer-preview-amd/fetch_models.js:206:19)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async file:///C:/src/webnn-developer-preview-amd/fetch_models.js:226:13
[30/40] Downloading https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_decoder_static_kvcache_128_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_decoder_static_kvcache_128_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx
-> downloading [========================================] 100% 0.0s
[30/40] Downloaded https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_decoder_static_kvcache_128_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_decoder_static_kvcache_128_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx
[31/40] Downloading https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_decoder_static_non_kvcache_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_decoder_static_non_kvcache_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx
-> downloading [========================================] 100% 0.0s
[31/40] Downloaded https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_decoder_static_non_kvcache_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_decoder_static_non_kvcache_lm_fp16_layernorm_gelu_4dmask_iobinding.onnx
[32/40] Downloading https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_encoder_lm_fp16_layernorm_gelu.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_encoder_lm_fp16_layernorm_gelu.onnx
-> downloading [========================================] 100% 0.0s
[32/40] Downloaded https://huggingface.co/webnn/whisper-base-webnn/resolve/main/whisper_base_encoder_lm_fp16_layernorm_gelu.onnx to C:\src\webnn-developer-preview-amd\demos\whisper-base\models\whisper_base_encoder_lm_fp16_layernorm_gelu.onnx
| @@ -0,0 +1,2026 @@ | |||
| { | |||
| "architectures": [ | |||
| "ResNetForImageClassification" | |||
There was a problem hiding this comment.
I was trying the sample locally- I did get back an inference but did see some log output indicating attempts at local file system access... is this expected?
[60792:33108:0407/135409.409:ERROR:services\webnn\ort\environment.cc:89] : [ORT] [FATAL: onnxruntime, vaiml_mlopslib_partition_rule.cpp:1317 vaiml_mlopslib_partition_rule.cpp] Failed to open "C:\\temp\\adityar\\vaip\\.cache\\ef572deb32890331e9d986c1826163b6\\aie_unsupported_original_ops.json"
There was a problem hiding this comment.
Including the logs from about://gpu here as well. It seems like that perhaps the computation in my local testing is happening on the CPU?
[53892:58412:0407/140321.915:ERROR:services\webnn\ort\environment.cc:89] : [ORT] [INFO: onnxruntime, stat.cpp:193 stat.cpp] [Vitis AI EP] No. of Operators :
[53892:58412:0407/140321.915:ERROR:services\webnn\ort\environment.cc:89] : [ORT] [INFO: onnxruntime, stat.cpp:204 stat.cpp] CPU 124
[53892:58412:0407/140321.915:ERROR:services\webnn\ort\environment.cc:89] : [ORT] [INFO: onnxruntime, stat.cpp:213 stat.cpp]
No description provided.