Skip to content

Commit 083d70f

Browse files
NVMe write warning
Signed-off-by: tunji-ruwase_snow <tunji.ruwase@snowflake.com>
1 parent d99a642 commit 083d70f

5 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/aws-torch-latest-full.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ jobs:
359359
rm -rf /mnt/aio/pytest
360360
pytest --instafail --timeout 600 --forked -n 8 --basetemp=/mnt/aio/pytest unit/ \
361361
--ignore=unit/runtime/zero/test_nvme_checkpointing.py \
362-
--ignore=unit/ops/aio/test_gds.py \
362+
--ignore=unit/v1/nvme/test_gds.py \
363363
--ignore=unit/launcher/test_user_args.py \
364364
--ignore=unit/runtime/zenflow \
365365
--ignore=unit/ops/adam/test_zf_torch_adam.py \
@@ -372,7 +372,7 @@ jobs:
372372
rm -rf /mnt/aio/pytest
373373
pytest --instafail --timeout 600 -m 'sequential' --basetemp=/mnt/aio/pytest unit/ \
374374
--ignore=unit/runtime/zero/test_nvme_checkpointing.py \
375-
--ignore=unit/ops/aio/test_gds.py \
375+
--ignore=unit/v1/nvme/test_gds.py \
376376
--ignore=unit/launcher/test_user_args.py \
377377
--ignore=unit/runtime/zenflow \
378378
--ignore=unit/ops/adam/test_zf_torch_adam.py \

csrc/aio/py_lib/deepspeed_aio_op_desc.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,30 @@
55

66
#include "deepspeed_aio_op_desc.h"
77

8+
#include <mutex>
9+
810
using namespace std;
911

12+
namespace {
13+
// Warn home users only once per process: repeatedly offloading data (e.g. hidden
14+
// states) to a consumer SSD can exhaust its rated write endurance (TBW).
15+
std::once_flag write_warning_flag;
16+
17+
void warn_consumer_ssd_writes()
18+
{
19+
const char* msg =
20+
"Offloading to NVMe can generate heavy write traffic. On consumer/home SSDs, repeatedly "
21+
"offloading data (e.g. optimizer states, hidden states) can blow through the drive's "
22+
"rated write endurance (TBW) and shorten its lifespan. Prefer enterprise/datacenter SSDs "
23+
"for sustained offloading workloads.";
24+
25+
// Route through DeepSpeed's Python logger. Acquire the GIL since this may be
26+
// invoked from a non-Python thread.
27+
pybind11::gil_scoped_acquire acquire;
28+
pybind11::module_::import("deepspeed.utils").attr("logger").attr("warning")(msg);
29+
}
30+
} // namespace
31+
1032
io_op_desc_t::io_op_desc_t(const bool read_op,
1133
const torch::Tensor& buffer,
1234
const int fd,
@@ -24,6 +46,7 @@ io_op_desc_t::io_op_desc_t(const bool read_op,
2446
_validate(validate)
2547
{
2648
if (validate) { assert(nullptr != filename); }
49+
if (!read_op) { std::call_once(write_warning_flag, warn_consumer_ssd_writes); }
2750
}
2851

2952
char* io_op_desc_t::data_ptr() const { return (char*)_contiguous_buffer.data_ptr(); }
File renamed without changes.

0 commit comments

Comments
 (0)