CANN基础设施用户指南 3.1 Environment Lifecycle Management【免费下载链接】infrastructure本仓库用于托管CANN社区基础设施团队的公开信息包括不限于会议日程成员信息服务文档和配置等信息项目地址: https://gitcode.com/cann/infrastructureCANNLab instances have the following states:StateDescriptionConsumes Card-HoursRunningInstance is running, development operations availableYesStoppedInstance is stopped,/mnt/workspaceand/homedata retainedNoSleepingAuto-suspended after prolonged inactivity, data retainedNoDeletedInstance is destroyed, data unrecoverable-Operations:Stop: Stop the instance and release computing resources. Data under/mnt/workspaceand/homeis persisted; data in other directories is lost.Start: Restart a stopped or sleeping instance.Delete: Permanently destroy the instance.All data is unrecoverable after deletion.Please back up or push code to a Git repository in advance.NoteNPU resource types (A2/A3) do not support direct switching. You need to stop, delete, and then recreate the instance.3.2 Computing Resource Management3.2.1 Resource SpecificationsResource TypeChip ModelSpecification OptionsDurationDescriptionNPU (A2)Ascend A21-card: 16vCPUs/32GiB100 card-hoursGeneral NPU computing1-card: 32vCPUs/32GiB8-card: 192vCPUs/1536GiBNPU (A3)Ascend A31-card: 40vCPUs/240GiB100 card-hoursHigh-end NPU computing8-card: 320vCPUs/1920GiBCPU (ARM)Kunpeng16vCPUs/32GiB720 core-hoursARM only, x86 not supported3.2.2 Usage RulesDevelopers:Total of 100 card-hours. When card-hours are exhausted, the instance willautomatically shut downand release resources.Computing consumption is measured in card-hours. For example, a 2-card instance can be used for a maximum of 50 hours.It is recommended to stop or delete instances when not in use to avoid unnecessary quota consumption.3.2.3 Resource Application LimitsYou can apply forone NPU resource and one CPU resource.Switching NPU resource types (e.g., A2 → A3) requires stopping, deleting, and recreating the instance.Note: When an instance is deleted,/mnt/workspaceand/homedata are not retained.3.3 CANN Software Stack Management3.3.1 Check CANN VersionThe CANN package is pre-installed at/home/developer/Ascend(note: this differs from the default installation path/usr/local/Ascend).Method 1: Check environment variablesenv | grep ASCENDMethod 2: View version filecat /home/developer/Ascend/ascend-toolkit/latest/opp/version.info3.3.2 Check Driver VersionThe current driver version is25.5.1, installed at/usr/local/Ascend/driver.cat /usr/local/Ascend/driver/version.info | grep Version3.3.3 Upgrade CANN VersionMethod 1: One-click upgrade from console (Recommended)In the CANNLab instance list, click theCANN Package Upgradebutton.Select the upgradable CANN package version (e.g., 9.0.0 official release, master branch build).Verify the upgrade result:cd /home/developer/.cann ./manage_cann_pkg.sh --versionA result oftask.status 1andprocess 100%indicates a successful upgrade.Method 2: Manual installationAfter connecting via WebIDE or VSCode, manually download and install in the terminal.3.3.4 Driver Version UpgradePersonal instance driver version upgrades are not currently supported; upgrades are managed uniformly by the platform. If you have driver version dependencies, please submit an Issue in the Dev-experience repository.3.4 Data Management3.4.1 Persistent StorageDirectoryPersistentDescription/mnt/workspace✅ YesData retained after instance shutdown, cleared upon instancedeletion/home✅ YesData retained after instance shutdown, cleared upon instancedeletionOther system directories❌ NoData lost after instance deletionImportant NotesStore important files such as code projects, datasets, and model files under/mnt/workspaceor/home.Instance deletion is irreversible. Please back up important data in advance.3.4.2 File Upload and DownloadFile upload/download is supported directly via the WebIDE interface or VSCode plugin.3.4.3 Automatic Code PullWhen creating an environment, you canadd a preloaded code repository. During environment instantiation, the repository will beautomatically clonedto/mnt/workspace, with no manual pull required. If no preloaded code repository is added when creating the environment, no repository will be cloned during instantiation.3.5 Code Project Management3.5.1 Switch Project DirectoryIn WebIDE: File - Open Project - Select the corresponding repository directory.3.5.2 Branch ManagementThe automatically cloned code is from themasterbranch. For other branches, please switch manually. Branch specification functionality is currently under development.3.5.3 Git Password-Free OperationsThe platform automatically configures SSH public/private keys based on GitCode account binding, makinggit clone/git pushpassword-free.3.6 Built-in Development Tools3.6.1 Huawei OP DevTools (Operator Development Plugin)Pre-installed in the cloud development environment, providing:FeatureDescriptionProject CreationOne-click creation of pyasc operators and standard custom operatorsCompilation ExecutionVisual compilation and execution, supports chip type configuration (A3/A5)DebuggingSupports DumpTensor debugging, data persistence, and visualizationAnomaly DetectionDetects code anomalies, supports error location and navigationPerformance TuningPerformance swimlane analysis and result chartingAccuracy ComparisonDumpTensor data visualization for accuracy comparisonUT TestingUnit testing for standard custom operatorsUpgrade MethodAfter connecting to the environment, search for Huawei OP DevTools in the left sidebar Extensions. If an Update icon appears on the Huawei OP DevTools plugin, a new version has been released. Update the version on the plugin details page. To simplify future operations, it is recommended to enable Auto Update on the plugin details page so later plugin versions are upgraded silently.3.6.2 PyPTO ToolkitPre-installed in the cloud development environment, a high-performance programming framework for AI accelerators that simplifies the development of complex fused operators and model networks.FeatureDescriptionTile Programming ModelHardware-aware data block (Tile) programming paradigm, fully leveraging NPU parallel capabilitiesMulti-level IR CompilationTensor Graph → Tile Graph → Block Graph → Execution Graph automatic compilation optimizationAutomatic Code GenerationCompiles to generate PTO virtual instructions, then compiles to target platform executable codeLayered AbstractionTensor layer for algorithm developers, Tile layer for performance experts, Block layer for system developersAccuracy VerificationGolden reference generation, accuracy comparison and localization, binary comparisonPerformance TuningMeasured performance data analysis, bottleneck localization, iterative optimizationUse CasesComplex fused operator development (e.g., FlashAttention, MLA)Large model operator-level implementation and optimizationOperator development requiring extreme performance tuningUpgrade MethodAfter connecting to the environment, search for PyPTO Toolkit in the left sidebar Extensions. If an Update icon appears on the PyPTO Toolkit plugin, a new version has been released. Update the version on the plugin details page. To simplify future operations, it is recommended to enable Auto Update on the plugin details page so later plugin versions are upgraded silently.3.6.3 OpenCodeThe OpenCode tool is built into the terminal, supporting natural language interactive coding assistance.Configuration MethodVerify that opencode is built into the environment:opencode --versionOpen the configuration file:/home/developer/.config/opencode/opencode.jsonAdd provider configuration to the file (using GLM-4-7 as an example):provider: { myprovider: { npm: ai-sdk/openai-compatible, name: volcengine, options: { baseURL: https://ark.cn-beijing.volces.com/api/v3, apiKey: *** }, models: { END_POINT_ID: { name: GLM-4-7-END_POINT_ID } } } }Runopencodein the terminal and enter/modelsto select a model and start using.Upgrade MethodAfter connecting to the environment, search for CANNBot Toolkit in the left sidebar Extensions. If an Update icon appears on the CANNBot Toolkit plugin, a new version has been released. Update the version on the plugin details page. To simplify future operations, it is recommended to enable Auto Update on the plugin details page so later plugin versions are upgraded silently.3.7 Image Management3.7.1 View Current Image VersionMethod 1:On the CANNLab instance list page, hover over Image/Specification to view details.Method 2:Run the following command in the environmentcat /home/developer/image-version.txt3.7.2 Image Version UpdateScenarioOperation MethodNeed a fresh environmentStop - Delete instance - Recreate (back up data first)Upgrade CANN package onlyUse the CANN Package Upgrade buttonUpgrade operator plugin onlySearch for the plugin name in Extensions and updateUpgrade OpenCode onlySearch for CANNBot Toolkit in Extensions and updateNote:Direct image upgrade is not currently supported.【免费下载链接】infrastructure本仓库用于托管CANN社区基础设施团队的公开信息包括不限于会议日程成员信息服务文档和配置等信息项目地址: https://gitcode.com/cann/infrastructure创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考