Azure Synapse中PyTorch导入引发Spark会话失败求助
Azure Synapse Notebook会话失败排查求助
环境与依赖库
我的Azure Synapse Notebook使用以下Python库:
import pandas as pd import numpy as np from sqlalchemy import create_engine, text import sqlalchemy as sa from azure.core.credentials import AzureKeyCredential from azure.ai.textanalytics import TextAnalyticsClient from sentence_transformers import SentenceTransformer, util import time import torch from notebookutils import mssparkutils
问题现象
本月起,执行完上述导入代码的单元格后,会话停止并弹出如下警告:
/home/trusted-service-user/cluster-env/env/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory warn(f"Failed to load image Python extension: {e}") 2024-11-19 11:31:17.000433: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
随后Spark会话失败,提示Session failed. Run the notebook to start a new session.。该Notebook在2-3周前运行正常,此前即使出现上述警告也不影响使用。
已尝试的解决方案
- 回退Torch版本
- 强制使用CPU运行
以上操作均未解决问题。
附加Spark驱动stderr日志
WARN TokenLibrary [pool-43-thread-2]: Access token cache miss or expired 2024-11-19 11:24:16,395 ERROR TokenLibrary [pool-43-thread-2]: Unable to determine host value from URI = tokenservice2.westeurope.azuresynapse.net:443. Using localhost as header value WARN SQLConf [spark-listener-group-shared]: The SQL config 'spark.sql.legacy.replaceDatabricksSparkAvro.enabled' has been deprecated in Spark v3.2 and may be removed in the future. Use `.format("avro")` in `DataFrameWriter` or `DataFrameReader` instead. 2024-11-19 11:23:32,622 WARN AzureBlobFileSystemStore [Thread-32]: checkDnsEntry: blabla.dfs.core.windows.net not found in the file /etc/hosts.
请求协助排查并解决该会话失败问题。
内容的提问来源于stack exchange,提问作者Dimitar Petrov
相关产品推荐
相关产品推荐

