arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.08903cs.CRcs.AIcs.AR
收藏

TensorTEE:统一异构TEE粒度以实现高效的安全协同张量计算

TensorTEE: Unifying Heterogeneous TEE Granularity for Efficient Secure Collaborative Tensor Computing

Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Cambricon Technologies(寒武纪科技);Shanghai Jiao Tong University(上海交通大学);Peking University(北京大学);University of Science and Technology of China(中国科学技术大学);ZGC LAB(中关村实验室);Shanghai Innovation Center for Processor Technologies, SHIC(上海处理器技术创新中心);Engineering Research Center for Domain-specific Operating Systems (MoE)(教育部专用操作系统工程研究中心)

Husheng Han, Xinyao Zheng, Yuanbo Wen, Yifan Hao, Erhu Feng, Ling Liang, Jianan Mu, Xiaqing Li, Tianyun Ma, Pengwei Jin, Xinkai Song, Zidong Du, Qi Guo, Xing Hu

AI总结:

针对现有异构TEE因CPU与NPU内存粒度差异导致协同计算效率低的问题,提出张量粒度统一的TensorTEE方案,通过片上张量维护、预测式张量MAC管理及直接跨域传输,将LLM训练性能较现有方案提升4倍,仅带来2.1%的额外开销。

摘要:

NPU与CPU的异构协同计算凭借其显著的性能优势受到了广泛关注。为保障计算过程中的数据机密性与完整性,可信执行环境(Trusted Execution Environments, TEE)因开销相对较低被认为是一种极具前景的解决方案。但现有异构TEE设计因CPU与NPU之间内存粒度精细且存在差异,在协同计算中效率低下:1)CPU TEE的缓存行粒度因额外内存访问加剧了内存压力;2)NPU的缓存行粒度消息认证码(MAC)加剧了有限内存存储的压力;3)跨异构飞地的数据传输依赖非安全区域中转,导致重加密与调度过程繁琐。\n为解决这些问题,我们提出TensorTEE,一种统一的张量粒度异构TEE,用于实现高效的安全协同张量计算。首先,我们在CPU TEE中虚拟支持张量粒度,通过在片上检测并维护张量结构,消除片外元数据访问。其次,我们提出带预测执行的张量粒度MAC管理机制,在消除片外MAC存储与访问的同时避免计算停顿。此外,基于统一的粒度,我们实现了无需重加密且无调度困境的直接数据传输。我们的评估基于增强版Gem5和周期精确的NPU模拟器开展。结果表明,与现有工作相比,TensorTEE将大语言模型(Large Language Model, LLM)训练工作负载的性能提升了4.0倍,且与非安全训练相比仅产生2.1%的开销,为LLM训练提供了实用的安全保障。

英文摘要:

Heterogeneous collaborative computing with NPU and CPU has received widespread attention due to its substantial performance benefits. To ensure data confidentiality and integrity during computing, Trusted Execution Environments (TEE) is considered a promising solution because of its comparatively lower overhead. However, existing heterogeneous TEE designs are inefficient for collaborative computing due to fine and different memory granularities between CPU and NPU. 1) The cacheline granularity of CPU TEE intensifies memory pressure due to its extra memory access, and 2) the cacheline granularity MAC of NPU escalates the pressure on the limited memory storage. 3) Data transfer across heterogeneous enclaves relies on the transit of non-secure regions, resulting in cumbersome re-encryption and scheduling. To address these issues, we propose TensorTEE, a unified tensor-granularity heterogeneous TEE for efficient secure collaborative tensor computing. First, we virtually support tensor granularity in CPU TEE to eliminate the off-chip metadata access by detecting and maintaining tensor structures on-chip. Second, we propose tensor-granularity MAC management with predictive execution to avoid computational stalls while eliminating off-chip MAC storage and access. Moreover, based on the unified granularity, we enable direct data transfer without re-encryption and scheduling dilemmas. Our evaluation is built on enhanced Gem5 and a cycle-accurate NPU simulator. The results show that TensorTEE improves the performance of Large Language Model (LLM) training workloads by 4.0x compared to existing work and incurs only 2.1% overhead compared to non-secure training, offering a practical security assurance for LLM training.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑