jupyterlab安装指南

目录:

  1. 背景
  2. 参考资料
  3. 安装使用方法
    1. 环境准备
    2. 安装包准备
    3. 包安装及服务查看
    4. 启动服务
      1. 手动修改代码,指定ip
      2. 启动jupyter
  4. Reference

1. 背景

对于大模型的性能测试来说,往往采集的Profiling很大,或存在无法从服务器导出的场景。这时候使用图形化界面分析存在困难。

MindStudio Insight 提供了基于 jupyter 的插件可供使用,无需从服务器下载 Profiling 数据到本地,可以通过 Jupyter 以 web 界面的形式在本地进行分析。

2. 参考资料

MindStudio insight官方指导

3. 安装使用方法

3.1 环境准备

# 1.使用pip安装jupyterlab(python版本大于等于3.8以上不指定版本安装jupyterlab,jupyterlab应当满足jupyterlab>=4,<5的条件)
$ pip install jupyterlab
# 2.使用pip安装指定版本jupyterlab,如jupyterlab-4.0.11
$ pip install jupyterlab==4.0.11

安装完成后查看jupyterlab版本

$ jupyter -version

jupyter-plugin-install.png

3.2 安装包准备

参照 章节2 中提供的链接下载指定版本的MindStudio Insight Jupyter的whl包

3.3 包安装及服务查看

# 安装mindstudio_insight_jupyterlab插件包
$ pip install mindstudio_insight_jupyterlab-{version}-py3-none-{platform}.whl # version为版本号,platform为兼容平台

安装后可查看是否安装成功

$ jupyter server extension list

jupyter-plugin-install.png 如果安装后未启动,可使用下面命令拉起

$ jupyter server extension enable mindstudio_insight_jupyterlab --sys-prefix

3.4 启动服务

3.4.1 手动修改代码,指定ip
$ vi /usr/local/lib/python3.11/site-packages/mindstudio_insight_jupyterlab/handlers.py

修改 66 行和 89 行的 ip 为 "0.0.0.0"

jupyter-plugin-install.png

3.4.2 启动jupyter
$ jupyter lab --allow-root --port 9010 --ip 0.0.0.0

jupyter-plugin-install.png

复制回显中提供的url+token到本地浏览器中访问即可

jupyter-plugin-install.png

导入 Profiling 数据开始分析

jupyter-plugin-install.png

Reference

[1] MindStudio Insight. MindStudio insight官方指导. 2025.04. Wiki. [https://www.hiascend.com/forum/thread-0255181207629753032-1-1.html](https://www.hiascend.com/forum/thread-0255181207629753032-1-1.html)