Skip to content

Commit 05caca2

Browse files
authored
Merge pull request #1047 from SwanHubX/feature/backup
Feature/sync
2 parents 58aa9f2 + da175e5 commit 05caca2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1885
-351
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060

6161
## 🌟 最近更新
6262

63+
- 2025.06.08:♻️支持在本地存储完整的实验日志文件,通过 **swanlab sync** 上传本地日志文件到云端/私有化部署端;硬件监控支持**海光DCU**
64+
6365
- 2025.06.01:🏸支持**图表自由拖拽**;支持**ECharts自定义图表**,增加包括柱状图、饼状图、直方图在内的20+图表类型;硬件监控支持**沐曦GPU**;集成 **[PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP)** 框架;
6466

6567
- 2025.05.25:日志支持记录**标准错误流**,PyTorch Lightning等框架的打印信息可以被更好地记录;硬件监控支持**摩尔线程**;新增运行命令记录安全防护功能,API Key将被自动隐藏;
@@ -76,10 +78,10 @@
7678

7779
- 2025.04.07:我们与 [EvalScope](https://github.com/ModelScope/EvalScope) 完成了联合集成,现在你可以在EvalScope中使用SwanLab来**评估大模型性能**
7880

79-
- 2025.03.30:支持**swanlab.Settings**方法,支持更精细化的实验行为控制;支持**寒武纪MLU**硬件监控;支持 [Slack通知](https://docs.swanlab.cn/plugin/notification-slack.html)[Discord通知](https://docs.swanlab.cn/plugin/notification-discord.html)
80-
8181
<details><summary>完整更新日志</summary>
8282

83+
- 2025.03.30:支持**swanlab.Settings**方法,支持更精细化的实验行为控制;支持**寒武纪MLU**硬件监控;支持 [Slack通知](https://docs.swanlab.cn/plugin/notification-slack.html)[Discord通知](https://docs.swanlab.cn/plugin/notification-discord.html)
84+
8385
- 2025.03.21:🎉🤗HuggingFace Transformers已正式集成SwanLab(>=4.50.0版本),[#36433](https://github.com/huggingface/transformers/pull/36433);新增 **Object3D图表** ,支持记录与可视化三维点云,[文档](https://docs.swanlab.cn/api/py-object3d.html);硬件监控支持了 GPU显存(MB)、磁盘利用率、网络上下行 的记录;
8486

8587
- 2025.03.12:🎉🎉SwanLab**私有化部署版**现已发布!![🔗部署文档](https://docs.swanlab.cn/guide_cloud/self_host/docker-deploy.html);SwanLab 已支持插件扩展,如 [邮件通知](https://docs.swanlab.cn/plugin/notification-email.html)[飞书通知](https://docs.swanlab.cn/plugin/notification-lark.html)

README_EN.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Supports both cloud/offline usage, integrates with 30+ mainstream frameworks, an
5454

5555
## 🌟 Recent Updates
5656

57+
- 2025.06.08: ♻️ Added support for storing complete experiment log files locally and uploading them to the cloud/private deployment via **swanlab sync**; Hardware monitoring now supports **Hygon DCU**;
58+
5759
- 2025.06.01: 🏸 Added support for **chart free dragging**; added support for **ECharts custom chart**; added support for **PaddleNLP** framework; hardware monitoring supports **MetaX GPU**;
5860

5961
- 2025.05.25: Logging now supports capturing the **standard error stream**, allowing better recording of output from frameworks like PyTorch Lightning; hardware monitoring now includes support for **Moore Threads**; added a security feature for logging runtime commands, where API Keys will be automatically hidden.
@@ -70,11 +72,12 @@ Supports both cloud/offline usage, integrates with 30+ mainstream frameworks, an
7072

7173
- 2025.04.07: We completed joint integration with [EvalScope](https://github.com/ModelScope/EvalScope). Now you can use **SwanLab** in EvalScope to **evaluate LLM performance**.
7274

73-
- 2025.03.30: Added support for the **swanlab.Settings** method, enabling more precise control over experiment behavior; added support for **Cambricon MLU** hardware monitoring; integrated [Slack notifications](https://docs.swanlab.cn/plugin/notification-slack.html) and [Discord notifications](https://docs.swanlab.cn/plugin/notification-discord.html).
74-
7575

7676
<details><summary>Full Changelog</summary>
7777

78+
- 2025.03.30: Added support for the **swanlab.Settings** method, enabling more precise control over experiment behavior; added support for **Cambricon MLU** hardware monitoring; integrated [Slack notifications](https://docs.swanlab.cn/plugin/notification-slack.html) and [Discord notifications](https://docs.swanlab.cn/plugin/notification-discord.html).
79+
80+
7881
- 2025.03.21: 🎉🤗 HuggingFace Transformers has officially integrated SwanLab (version >=4.50.0), [#36433](https://github.com/huggingface/transformers/pull/36433); Added **Object3D chart** support, now you can track and visualize 3D point clouds, [docs](https://docs.swanlab.cn/en/api/py-object3d.html); Hardware monitoring supports the recording of GPU memory (MB), disk utilization, and network sent and received.
7982

8083
- 2025.03.12: 🎉🎉 The **Privatized Deployment Edition** of SwanLab is now available!! [🔗 Deployment Documentation](https://docs.swanlab.cn/en/guide_cloud/self_host/docker-deploy.html); SwanLab now supports plugin extensions, such as [Email Notification](https://docs.swanlab.cn/en/plugin/notification-email.html) and [Lark Notification](https://docs.swanlab.cn/en/plugin/notification-lark.html).

README_JP.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555
## 🌟 最近の更新
5656

57+
- 2025.06.08: ♻️ ローカルで完全な実験ログファイルを保存し、**swanlab sync** を使用してローカルログファイルをクラウド/プライベートデプロイにアップロード;ハードウェア監視で**海光DCU**をサポート;
58+
5759
- 2025.06.01: 🏸 グラフの**自由なドラッグ**をサポート;**EChartsカスタムグラフ**をサポート;**PaddleNLP**フレームワークを統合;ハードウェア監視で**MetaX GPU**をサポート;
5860

5961
- 2025.05.25: ログ機能で標準エラーストリームの記録をサポートし、PyTorch Lightningなどのフレームワークからの出力情報をより適切に記録可能に;ハードウェア監視でMoore Threadsをサポート;新たに実行コマンド記録のセキュリティ保護機能を追加、APIキーは自動的に非表示に;
@@ -70,10 +72,10 @@
7072

7173
- 2025.04.07: [EvalScope](https://github.com/ModelScope/EvalScope) との共同統合を完了しました。これにより、EvalScope内で **SwanLab** を使用して **大規模モデルの性能評価** が可能になりました。
7274

73-
- 2025.03.30: **swanlab.Settings** メソッドをサポートし、実験の動作をより詳細に制御可能に;**寒武紀MLU** ハードウェアの監視をサポート;[Slack通知](https://docs.swanlab.cn/plugin/notification-slack.html)[Discord通知](https://docs.swanlab.cn/plugin/notification-discord.html) をサポート。
75+
<details><summary>完全な更新履歴</summary>
7476

77+
- 2025.03.30: **swanlab.Settings** メソッドをサポートし、実験の動作をより詳細に制御可能に;**寒武紀MLU** ハードウェアの監視をサポート;[Slack通知](https://docs.swanlab.cn/plugin/notification-slack.html)[Discord通知](https://docs.swanlab.cn/plugin/notification-discord.html) をサポート。
7578

76-
<details><summary>完全な更新履歴</summary>
7779

7880
- 2025.03.21: 🎉🤗 HuggingFace Transformersは正式にSwanLab(バージョン >=4.50.0)を統合しました、[#36433](https://github.com/huggingface/transformers/pull/36433)。Object3Dチャートのサポートを追加しました。これにより、3D点群を追跡および可視化できます, [docs](https://docs.swanlab.cn/en/api/py-object3d.html)。ハードウェア監視は、GPUメモリ(MB)、ディスク使用率、ネットワーク送受信の記録をサポートします。
7981

README_RU.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353

5454
## 🌟 Последние обновления
5555

56+
- 2025.06.08: ♻️ Поддержка локального сохранения полных файлов журналов экспериментов и их синхронизации с облаком/частным размещением через **swanlab sync**; Мониторинг оборудования поддерживает **Hygon DCU**.
57+
5658
- 2025.06.01: 🏸 Поддержка свободного перетаскивания диаграмм; Поддержка настройки диаграмм ECharts с добавлением 20+ типов, включая столбчатые, круговые и гистограммы; Мониторинг оборудования поддерживает GPU沐曦; Интеграция фреймворка PaddleNLP.
5759

5860
- 2025.05.25: Поддержка записи **стандартного потока ошибок**, позволяет лучше записывать вывод из фреймворков, таких как PyTorch Lightning; мониторинг оборудования поддерживает **Moore Threads**; добавлена функция защиты записи команд запуска, где API Key будет автоматически скрыт.
@@ -71,10 +73,12 @@
7173

7274
- 2025.04.07: Мы завершили совместную интеграцию с [EvalScope](https://github.com/ModelScope/EvalScope). Теперь вы можете использовать **SwanLab** в EvalScope для **оценки производительности больших моделей**.
7375

74-
- 2025.03.30: Добавлена поддержка метода **swanlab.Settings**, обеспечивающего более точный контроль над поведением экспериментов; добавлена поддержка мониторинга оборудования **Cambricon MLU**; интегрированы уведомления через [Slack](https://docs.swanlab.cn/plugin/notification-slack.html) и [Discord](https://docs.swanlab.cn/plugin/notification-discord.html).
7576

7677
<details><summary>Полный список изменений</summary>
7778

79+
- 2025.03.30: Добавлена поддержка метода **swanlab.Settings**, обеспечивающего более точный контроль над поведением экспериментов; добавлена поддержка мониторинга оборудования **Cambricon MLU**; интегрированы уведомления через [Slack](https://docs.swanlab.cn/plugin/notification-slack.html) и [Discord](https://docs.swanlab.cn/plugin/notification-discord.html).
80+
81+
7882
- 2025.03.21: 🎉🤗 HuggingFace Transformers официально интегрировал SwanLab (версия >=4.50.0), [#36433](https://github.com/huggingface/transformers/pull/36433). Добавлена поддержка графиков Object3D, теперь вы можете отслеживать и визуализировать 3D облака точек, [docs](https://docs.swanlab.cn/en/api/py-object3d.html). Мониторинг оборудования поддерживает запись памяти GPU (МБ), использования диска, а также отправленных и полученных данных сети.
7983

8084
- 2025.03.12: 🎉🎉 SwanLab**самостоятельное размещение** теперь доступно! [🔗 Документация](https://docs.swanlab.cn/en/guide_cloud/self_host/docker-deploy.html); SwanLab теперь поддерживает расширение плагинов, таких как [Email Notification](https://docs.swanlab.cn/en/plugin/notification-email.html) и [Lark Notification](https://docs.swanlab.cn/en/plugin/notification-lark.html).

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swankit==0.2.0
1+
swankit==0.2.2
22
urllib3>=1.26.0
33
requests>=2.25.0
44
setuptools
@@ -10,4 +10,5 @@ boto3>=1.35.49
1010
botocore
1111
pydantic>=2.9.0
1212
pyecharts>=2.0.0
13+
wrapt>=1.17.0
1314
typing_extensions; python_version < '3.9'

swanlab/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .env import SwanLabEnv
44
from .package import get_package_version
55
from .swanlab_settings import Settings
6-
from .sync import sync_wandb, sync_tensorboardX, sync_tensorboard_torch, sync_mlflow
6+
from .sync import sync_wandb, sync_tensorboardX, sync_tensorboard_torch, sync_mlflow, sync
77

88
# 设置默认环境变量
99
SwanLabEnv.set_default()
@@ -35,5 +35,10 @@
3535
"get_config",
3636
"config",
3737
"OpenApi",
38+
"sync_wandb",
39+
"sync_mlflow",
40+
"sync_tensorboardX",
41+
"sync_tensorboard_torch",
42+
"sync",
3843
"__version__",
3944
]

swanlab/api/http.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ def proj_id(self):
111111
def projname(self):
112112
return self.__proj.name
113113

114+
@property
115+
def history_exp_count(self):
116+
return self.__proj.history_exp_count
117+
114118
@property
115119
def exp_id(self):
116120
return self.__exp.cuid
@@ -244,7 +248,7 @@ def upload_files(self, buffers: List[MediaBuffer]) -> Dict[str, Union[bool, List
244248

245249
# ---------------------------------- 接入后端api ----------------------------------
246250

247-
def mount_project(self, name: str, username: str = None, public: bool = None) -> ProjectInfo:
251+
def mount_project(self, name: str, username: str = None, public: bool = None):
248252
"""
249253
创建项目,如果项目已存在,则获取项目信息
250254
:param name: 项目名称
@@ -295,7 +299,6 @@ def _():
295299

296300
project: ProjectInfo = FONT.loading("Getting project...", _)
297301
self.__proj = project
298-
return project
299302

300303
def mount_exp(self, exp_name, colors: Tuple[str, str], description: str = None, tags: List[str] = None):
301304
"""
@@ -309,13 +312,11 @@ def mount_exp(self, exp_name, colors: Tuple[str, str], description: str = None,
309312
def _():
310313
"""
311314
先创建实验,后生成cos凭证
312-
:return:
313315
"""
314316
post_data = {
315317
"name": exp_name,
316318
"colors": list(colors),
317319
}
318-
319320
if description is not None:
320321
post_data["description"] = description
321322
if tags is not None:

swanlab/api/upload/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ def upload_columns(columns: List[ColumnModel], per_request_len: int = 3000):
125125
"MediaModel",
126126
"ColumnModel",
127127
"FileModel",
128+
"LogModel",
128129
]

swanlab/api/upload/model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@Description:
88
上传请求模型
99
"""
10+
import json
1011
from datetime import datetime
1112
from enum import Enum
1213
from typing import List, Optional, TypedDict, Literal
@@ -123,6 +124,15 @@ def __init__(
123124
epoch: int,
124125
buffers: List[MediaBuffer] = None,
125126
):
127+
128+
# -------------------------- 🤡这里是一点小小的💩 --------------------------
129+
# 要求上传时的文件路径必须带key_encoded前缀
130+
if buffers is not None:
131+
metric = json.loads(json.dumps(metric))
132+
for i, d in enumerate(metric["data"]):
133+
metric["data"][i] = "{}/{}".format(key_encoded, d)
134+
# ------------------------------------------------------------------------
135+
126136
self.metric = metric
127137
self.step = step
128138
self.epoch = epoch

swanlab/cli/commands/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
from .auth import login, logout
1111
from .converter import convert
1212
from .dashboard import watch
13+
from .sync import sync

0 commit comments

Comments
 (0)