FastVideo icon indicating copy to clipboard operation
FastVideo copied to clipboard

[Bug] Process halt when preprocessing i2v

Open yjhong89 opened this issue 1 year ago • 31 comments

Describe the bug

  • I ran this file https://github.com/hao-ai-lab/FastVideo/blob/main/scripts/preprocess/v1_preprocess_wan_data_i2v.sh and process halt https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L593

    • I set --samples_per_file 4 --flush_frequency 4 --preprocess_video_batch_size 1 (since my dataset has different aspect ratio. some data has longer height)
  • Looks like this. No more running after this point: https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L593

    • Arguments are not passed to here: https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L702

Image

  • Also not seemed as GPU issues

Image

Reproduction

  • I ran this file https://github.com/hao-ai-lab/FastVideo/blob/main/scripts/preprocess/v1_preprocess_wan_data_i2v.sh and process halt https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L593
    • I set --samples_per_file 4 --flush_frequency 4 --preprocess_video_batch_size 1 (since my dataset has different aspect ratio. some data has longer height)
    • For videos longer height, I set 832x480 (modify crop transformation: https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/dataset/init.py#L17)

Environment

  • Environment is CUDA 12.8 and Pytorch 2.7.1

yjhong89 avatar Jun 28 '25 13:06 yjhong89

  • If I set --samples_per_file 8 --flush_frequency 8 --preprocess_video_batch_size 1 (since my dataset has different aspect ratio. some data has longer height), same process hanging.

Image

yjhong89 avatar Jun 28 '25 13:06 yjhong89

  • When I replace ProcessPoolExecutor with simple for loop. it seems work: https://github.com/hao-ai-lab/FastVideo/blob/344e43006a2ae568272bfac26130b7aa4fdf4d34/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L670
471         for work_range in tqdm(work_ranges, desc="Processing chunks"):
472             try:
473                 written = self.process_chunk_range(work_range)
474                 total_written += written
475                 logger.info("Processed chunk with %s samples", written)
476             except Exception as e:
477                 failed_ranges.append(work_range)
478                 logger.error("Failed to process range %s-%s: %s",
479                              work_range[0], work_range[1], str(e))

Image

yjhong89 avatar Jun 28 '25 14:06 yjhong89

Just push a fix to main branch. Could you try again?

Edenzzzz avatar Jun 29 '25 00:06 Edenzzzz

which commit related to this issue ?? Still same.

Image

  • And this too faces same issue (https://github.com/hao-ai-lab/FastVideo/issues/565#issuecomment-3015302738)

yjhong89 avatar Jun 29 '25 04:06 yjhong89

  • This error occurs
[rank0]: Traceback (most recent call last):
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/v1_preprocess.py", line 97, in <module>
[rank0]:     main(args)
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/v1_preprocess.py", line 38, in main
[rank0]:     pipeline.forward(batch=None, fastvideo_args=fastvideo_args, args=args)
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
[rank0]:     return func(*args, **kwargs)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py", line 53, in forward
[rank0]:     self.preprocess_video_and_text(fastvideo_args, args)
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py", line 301, in preprocess_video_and_text
[rank0]:     for batch_idx, data in enumerate(pbar):
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/tqdm/std.py", line 1181, in __iter__
[rank0]:     for obj in iterable:
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 733, in __next__
[rank0]:     data = self._next_data()
[rank0]:            ^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 789, in _next_data
[rank0]:     data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch
[rank0]:     data.append(next(self.dataset_iter))
[rank0]:                 ^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 584, in __iter__
[rank0]:     yield self._get_item(idx)
[rank0]:           ^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 594, in _get_item
[rank0]:     batch = self.video_transform_stage.process(batch)
[rank0]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 325, in process
[rank0]:     video = self.transform(video)
[rank0]:             ^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torchvision/transforms/transforms.py", line 95, in __call__
[rank0]:     img = t(img)
[rank0]:           ^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/transform.py", line 143, in __call__
[rank0]:     clip_center_crop_resize = resize(
[rank0]:                               ^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/transform.py", line 63, in resize
[rank0]:     return torch.nn.functional.interpolate(
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/nn/functional.py", line 4678, in interpolate
[rank0]:     return torch._C._nn._upsample_bilinear2d_aa(
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: RuntimeError: [enforce fail at alloc_cpu.cpp:119] err == 0. DefaultCPUAllocator: can't allocate memory: you tried to allocate 260389080 bytes. Error code 12 (Cannot allocate memory)


yjhong89 avatar Jul 01 '25 00:07 yjhong89

Could you share your your environment (GPU) and the script you used? Thanks

SolitaryThinker avatar Jul 01 '25 00:07 SolitaryThinker

Environments

  • cuda 12.8 torch 2.7.1
Python 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'2.7.1+cu128'

Scripts

  • bash scripts/preprocess/v1_preprocess_wan_data_i2v.sh
# export WANDB_MODE="offline"
export TOKENIZERS_PARALLELISM=false

GPU_NUM=1 # 2,4,8
MODEL_PATH="/mnt/video_nfs6/projects/video_generation/Wan2.1/Wan2.1-I2V-14B-480P-Diffusers"
MODEL_TYPE="wan"

export DATASET_HOME="/mnt/video_nfs5/datasets/body_video_datasets"
export DATA_PROCESS_HOME="/mnt/video_nfs6/users/yjhong/FastVideo/data_preprocess"
DATA_VERSION="v3.0"
DATA_MERGE_PATH="${DATA_PROCESS_HOME}/${DATA_VERSION}_merge.txt"

height=480
width=832
num_frames=129
OUTPUT_DIR="${DATA_PROCESS_HOME}/${DATA_VERSION}_${height}x${width}x${num_frames}"

VALIDATION_PATH="mini_i2v_dataset/crush-smol_raw/validation.txt"

torchrun --nproc_per_node=$GPU_NUM \
    fastvideo/v1/pipelines/preprocess/v1_preprocess.py \
    --model_path $MODEL_PATH \
    --data_merge_path $DATA_MERGE_PATH \
    --preprocess_video_batch_size 1 \
    --max_height ${height} \
    --max_width ${width} \
    --num_frames ${num_frames} \
    --dataloader_num_workers 0 \
    --output_dir=$OUTPUT_DIR \
    --model_type $MODEL_TYPE \
    --train_fps 16 \
    --samples_per_file 8 \
    --flush_frequency 8 \
    --preprocess_task "i2v"

ETC

  • Remove ProcessPoolExecutor at here: https://github.com/hao-ai-lab/FastVideo/blob/eb0f1318f3646e4b9dd95516cf8c083ec31fe2c2/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L669
    • But actually both not work
        for work_range in tqdm(work_ranges, desc="Processing chunks"):
            try:
                written = self.process_chunk_range(work_range)
                total_written += written
                logger.info("Processed chunk with %s samples", written)
            except Exception as e:
                failed_ranges.append(work_range)
                logger.error("Failed to process range %s-%s: %s",
                             work_range[0], work_range[1], str(e))

#        with ProcessPoolExecutor(max_workers=num_workers) as executor:
#            futures = {
#                executor.submit(self.process_chunk_range, work_range):
#                work_range
#                for work_range in work_ranges
#            }
#            for future in tqdm(futures, desc="Processing chunks"):
#                try:
#                    written = future.result()
#                    total_written += written
#                    logger.info("Processed chunk with %s samples", written)
#                except Exception as e:
#                    work_range = futures[future]
#                    failed_ranges.append(work_range)
#                    logger.error("Failed to process range %s-%s: %s",
#                                 work_range[0], work_range[1], str(e))

yjhong89 avatar Jul 01 '25 01:07 yjhong89

could you try adding --video_length_tolerance_range 5? Also we've updated the scripts here and it is runnable e2e on current main: https://github.com/hao-ai-lab/FastVideo/tree/main/examples/training/finetune/wan_t2v_1_3b/crush_smol

If you still have trouble could you please share some of your sample datasets so I can try replicating the issue?

Thanks

SolitaryThinker avatar Jul 01 '25 05:07 SolitaryThinker

@SolitaryThinker, Thanks for your comment.

  • I put video_length_tolerance_range 5 and run the script. It seems okay so far but I am not sure there will be no hanging.
  • But I think same thing would happen since video_length_tolerance_range is set to 2 by default: https://github.com/hao-ai-lab/FastVideo/blob/19674c6f29db34528daa38896101bd2b15aed6a7/fastvideo/v1/pipelines/preprocess/v1_preprocess.py#L73
    • So setting this value to 5 may mean just include more samples than before.

Image

  • Yes I checked this e2e i2v script at here: https://github.com/hao-ai-lab/FastVideo/tree/main/examples/training/finetune/wan_i2v_14b_480p/crush_smol

    • e2e means end to end??
  • I am using HumanVid dataset (https://github.com/zhenzhiwang/HumanVid?tab=readme-ov-file#news). It cannot be redistributed in the internet so I put 5 samples in my private folder

yjhong89 avatar Jul 01 '25 06:07 yjhong89

Yes e2e means end to end. I just meant that if you directly follow the readme in that directly preprocessing and finetune should work.

Please let me know if it hangs again and I'll take a look. Thanks for your patience

SolitaryThinker avatar Jul 01 '25 06:07 SolitaryThinker

Same hanging occurs.

Image

yjhong89 avatar Jul 01 '25 07:07 yjhong89

  • I ran preprocess script in https://github.com/hao-ai-lab/FastVideo/tree/main/examples/training/finetune/wan_i2v_14b_480p/crush_smol to my dataset, but it stil doesn't work (hanging after process some data)
  • Still don't know why.

yjhong89 avatar Jul 01 '25 08:07 yjhong89

Current Status (250708)

  • Run https://github.com/hao-ai-lab/FastVideo/blob/main/examples/training/finetune/wan_i2v_14b_480p/crush_smol/preprocess_wan_data_i2v.sh this script hanged at this point.
  • I manually check datalist on the screenshot, and they are all normal.
Image

Fix

  • I suspect multi-thread operation may cause this hanging issue so I replace ProcessPoolExectuor with native "for" loop. https://github.com/hao-ai-lab/FastVideo/blob/6198c6a640a867baeecd3684b579a1ab7df1356d/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py#L670

  • Running script after fix this did not raise hanging at the mentioned point, but still need to watch (still on going so far).

Image

Suggestion

  • Multi-gpu supported for pre-processing (@SolitaryThinker ) ? It takes so long for under 10k datasets (I am preprocessing on A100 machine) : https://github.com/hao-ai-lab/FastVideo/blob/6198c6a640a867baeecd3684b579a1ab7df1356d/fastvideo/v1/pipelines/preprocess/v1_preprocess.py#L23

yjhong89 avatar Jul 08 '25 02:07 yjhong89

Error occured from fixed one (above comment)

NFO 07-09 08:37:20 [preprocess_pipeline_base.py:675] Processed chunk with 8 samples                                                                                                     | 0/1 [00:00<?, ?it/s]
Processing chunks: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.39it/s]
INFO 07-09 08:37:20 [preprocess_pipeline_base.py:710] Total samples written: 8██████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.39it/s]
Processing videos:  41%|██████████████████████████████████████████▏                                                            | 3192/7799 [38:25:05<55:26:55, 43.33s/batch]
[rank0]: Traceback (most recent call last):
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/v1_preprocess.py", line 100, in <module>
[rank0]:     main(args)
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/v1_preprocess.py", line 38, in main
[rank0]:     pipeline.forward(batch=None, fastvideo_args=fastvideo_args, args=args)
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
[rank0]:     return func(*args, **kwargs)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py", line 53, in forward
[rank0]:     self.preprocess_video_and_text(fastvideo_args, args)
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/pipelines/preprocess/preprocess_pipeline_base.py", line 301, in preprocess_video_and_text
[rank0]:     for batch_idx, data in enumerate(pbar):
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/tqdm/std.py", line 1181, in __iter__
[rank0]:     for obj in iterable:
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 733, in __next__
[rank0]:     data = self._next_data()
[rank0]:            ^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 789, in _next_data
[rank0]:     data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch
[rank0]:     data.append(next(self.dataset_iter))
[rank0]:                 ^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 586, in __iter__
[rank0]:     yield self._get_item(idx)
[rank0]:           ^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 596, in _get_item
[rank0]:     batch = self.video_transform_stage.process(batch)
[rank0]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 323, in process
[rank0]:     torchvision_video, _, metadata = torchvision.io.read_video(
[rank0]:                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torchvision/io/video.py", line 373, in read_video
[rank0]:     vframes = torch.as_tensor(np.stack(vframes_list))
[rank0]:                               ^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/numpy/core/shape_base.py", line 456, in stack
[rank0]:     return _nx.concatenate(expanded_arrays, axis=axis, out=out,
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: numpy.core._exceptions._ArrayMemoryError: Unable to allocate 5.59 GiB for an array with shape (905, 2048, 1080, 3) and data type uint8
[rank0]:[W709 08:40:42.598434247 ProcessGroupNCCL.cpp:1479] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
E0709 08:40:57.490000 12965 torch/distributed/elastic/multiprocessing/api.py:874] failed (exitcode: 1) local_rank: 0 (pid: 13030) of binary: /usr/bin/python3.12
Traceback (most recent call last):
  File "/usr/local/bin/torchrun", line 33, in <module>
    sys.exit(load_entry_point('torch==2.7.1+cu128', 'console_scripts', 'torchrun')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 355, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/run.py", line 892, in main
    run(args)
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/run.py", line 883, in run
    elastic_launch(
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/launcher/api.py", line 139, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/launcher/api.py", line 270, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
fastvideo/v1/pipelines/preprocess/v1_preprocess.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2025-07-09_08:40:57
  host      : f615d599f9c0
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 13030)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

  • It seemed too big raw video data raise memory issue.
  • Is there any option to filter out too long videos ?
    • I will gonna set video_tolerance_range to 2 (currently set to 5)
    • https://github.com/hao-ai-lab/FastVideo/blob/6198c6a640a867baeecd3684b579a1ab7df1356d/fastvideo/v1/dataset/preprocessing_datasets.py#L239

yjhong89 avatar Jul 08 '25 23:07 yjhong89

  • Same error occured. Maybe there is memory leak.

yjhong89 avatar Jul 10 '25 00:07 yjhong89

  • Same error occured. Maybe there is memory leak.

Exactly. I noticed a memory leak when running the script examples/training/finetune/wan_t2v_1_3b/crush_smol/preprocess_wan_data_t2v.sh with my own large dataset.

As shown below, I used a single GPU for preprocessing. At step 293, the CPU memory usage reached 862 GB: Image Image

At step 511, the CPU memory usage increased further to 1.43 TB: Image Image

vviper25 avatar Jul 10 '25 07:07 vviper25

Thank you for the reports. We are currently in the process of fixing/refactoring preprocessing and plan on addressing all of these issues. @Eigensystem could you give an update?

SolitaryThinker avatar Jul 10 '25 20:07 SolitaryThinker

I got this error message. (memory issue)

[rank0]:     for obj in iterable:
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 733, in __next__
[rank0]:     data = self._next_data()
[rank0]:            ^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 789, in _next_data
[rank0]:     data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch
[rank0]:     data.append(next(self.dataset_iter))
[rank0]:                 ^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 586, in __iter__
[rank0]:     yield self._get_item(idx)
[rank0]:           ^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 596, in _get_item
[rank0]:     batch = self.video_transform_stage.process(batch)
[rank0]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 325, in process
[rank0]:     video = torchvision_video[batch.sample_frame_index]
[rank0]:             ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: RuntimeError: [enforce fail at alloc_cpu.cpp:119] err == 0. DefaultCPUAllocator: can't allocate memory: you tried to allocate 802483200 bytes. Error code 12 (Cannot allocate memory)
[rank0]:[W711 01:47:54.080284908 ProcessGroupNCCL.cpp:1479] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())

@vviper25 , how did you get memory profile?? seems useful.

yjhong89 avatar Jul 11 '25 00:07 yjhong89

I got this error message. (memory issue)

[rank0]:     for obj in iterable:
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 733, in __next__
[rank0]:     data = self._next_data()
[rank0]:            ^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/dataloader.py", line 789, in _next_data
[rank0]:     data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch
[rank0]:     data.append(next(self.dataset_iter))
[rank0]:                 ^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 586, in __iter__
[rank0]:     yield self._get_item(idx)
[rank0]:           ^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 596, in _get_item
[rank0]:     batch = self.video_transform_stage.process(batch)
[rank0]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/FastVideo/fastvideo/v1/dataset/preprocessing_datasets.py", line 325, in process
[rank0]:     video = torchvision_video[batch.sample_frame_index]
[rank0]:             ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: RuntimeError: [enforce fail at alloc_cpu.cpp:119] err == 0. DefaultCPUAllocator: can't allocate memory: you tried to allocate 802483200 bytes. Error code 12 (Cannot allocate memory)
[rank0]:[W711 01:47:54.080284908 ProcessGroupNCCL.cpp:1479] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())

@vviper25 , how did you get memory profile?? seems useful.

htop

vviper25 avatar Jul 14 '25 05:07 vviper25

How is it going about this issue? Seems there are preprocessing update.

yjhong89 avatar Jul 29 '25 09:07 yjhong89