Skip to content

Purge InternVideo2 - #1451

Merged
thomasdhc merged 7 commits into
mainfrom
aot/remove-internvideo2
Feb 4, 2026
Merged

Purge InternVideo2#1451
thomasdhc merged 7 commits into
mainfrom
aot/remove-internvideo2

Conversation

@suiyoubi

@suiyoubi suiyoubi commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Description

Usage

# Add snippet demonstrating usage

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

Signed-off-by: Ao Tang <aot@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Feb 2, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@suiyoubi

suiyoubi commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2f16c57

@greptile-apps

greptile-apps Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR purges InternVideo2 support across the video curation stack: it removes the InternVideo2 model/stages/tests and drops the CI + Docker steps that cloned/patched the upstream InternVideo repo. Documentation is updated to position Cosmos-Embed1 as the sole embedding backend, and ClipWriterStage is simplified to only write Cosmos-Embed1 embeddings (pickle + Parquet) while also accepting cosmos-embed1-* variants.

Main concern: several video docs/tutorials still reference the removed InternVideo2 output directories and helpers (iv2_embd*, get_output_path_iv2_embd_parquet) even though those code paths were deleted, which will lead to broken copy/paste instructions.

Confidence Score: 3/5

  • Generally safe to merge, but a few documentation and lifecycle robustness issues should be addressed first.
  • Most changes are deletions of InternVideo2 code and build plumbing, which reduces surface area. However, multiple docs still reference removed iv2_* outputs/helpers, and ClipWriterStage now relies on setup() to initialize its embedding buffer which could break direct invocations if the stage lifecycle is bypassed.
  • docs/curate-video/save-export.md, docs/curate-video/process-data/dedup.md, docs/curate-video/tutorials/split-dedup.md, docs/curate-video/process-data/index.md, nemo_curator/stages/video/io/clip_writer.py

Important Files Changed

Filename Overview
.github/workflows/cicd-main.yml Removes InternVideo2 cache/checkout/patch and related uv add step from CI.
docker/Dockerfile Removes cloning/patching InternVideo repo and uv add of InternVideo2 multimodality from container build.
docs/curate-video/process-data/dedup.md Docs still reference iv2_embd_parquet outputs even though InternVideo2 is removed; likely needs cleanup.
docs/curate-video/save-export.md Save/export docs still list iv2_embd*/helper usage after InternVideo2 purge; misleading/outdated.
docs/curate-video/tutorials/split-dedup.md Split+dedup tutorial still references iv2_embd_parquet paths/embedding_dim values inconsistent with Cosmos-Embed1-only.
nemo_curator/stages/video/io/clip_writer.py Removes InternVideo2 embedding outputs and broadens Cosmos-Embed1 algorithm matching to variants; potential lifecycle robustness issue if setup isn't called.

Sequence Diagram

sequenceDiagram
  participant User as User/Caller
  participant Pipe as Pipeline
  participant Writer as ClipWriterStage
  participant Storage as Storage (local/S3)

  User->>Pipe: run()
  Pipe->>Writer: setup(worker_metadata)
  Pipe->>Writer: process(VideoTask)

  loop for each clip
    Writer->>Writer: _write_clip_embedding_to_buffer(clip)
  end

  par clip-level writes (thread pool)
    loop for each clip
      Writer->>Storage: write clip mp4 (optional)
      Writer->>Storage: write preview webp (optional)
      Writer->>Storage: write embedding pickle (Cosmos-Embed1 only)
      Writer->>Storage: write clip metadata JSON
    end
  and filtered clip writes
    loop for each filtered clip
      Writer->>Storage: write filtered clip mp4 (optional)
      Writer->>Storage: write filtered clip metadata JSON
    end
  end

  Writer->>Storage: write CE1 parquet batch (ce1_embd_parquet/)
  Writer->>Storage: write video metadata JSON + chunk metadata JSON

  Writer->>Writer: cleanup in-memory buffers on clips/windows
  Pipe-->>User: completed
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (6)

nemo_curator/tasks/video.py
Remove these InternVideo2 field definitions from the Clip class.


nemo_curator/tasks/video.py
Remove this InternVideo2 test field definition.


nemo_curator/tasks/video.py
Remove InternVideo2 size calculations from get_major_size() method.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


nemo_curator/stages/video/io/clip_writer.py
Remove this InternVideo2 embedding cleanup line.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


tests/tasks/test_video.py
Remove InternVideo2 test data references.


tests/tasks/test_video.py
Remove InternVideo2 size calculations from test expectations.

Signed-off-by: Ao Tang <aot@nvidia.com>
@suiyoubi

suiyoubi commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7e0ad4d

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ayushdg ayushdg added the r1.1.0 Pick this label for auto cherry-picking into r1.1.0 label Feb 2, 2026
@ayushdg
ayushdg requested a review from thomasdhc February 2, 2026 21:12

@praateekmahajan praateekmahajan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's wait for @thomasdhc to also TAL

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 12 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (12)

nemo_curator/stages/video/io/clip_writer.py
InternVideo2 helper methods still present but no longer used


docs/curate-video/save-export.md
Reference to removed InternVideo2 method get_output_path_iv2_embd_parquet

ce1_parquet_dir = ClipWriterStage.get_output_path_ce1_embd_parquet(OUT)

docs/curate-video/tutorials/split-dedup.md
InternVideo2 references still present in text - should only mention ce1_embd_parquet/


docs/curate-video/tutorials/split-dedup.md
Directory should be ce1_embd_parquet/ not iv2_embd_parquet/

  ce1_embd_parquet/

docs/curate-video/tutorials/split-dedup.md
Path should be ce1_embd_parquet not iv2_embd_parquet

table = pq.read_table(f"{OUT_DIR}/ce1_embd_parquet")

docs/curate-video/tutorials/split-dedup.md
Path should be ce1_embd_parquet not iv2_embd_parquet

INPUT_PARQUET = f"{OUT_DIR}/ce1_embd_parquet"  # or s3://...

docs/curate-video/tutorials/split-dedup.md
Should only reference ce1_embd_parquet, not iv2_embd_parquet

  - Embeddings parquet: `${OUT_DIR}/ce1_embd_parquet`

docs/curate-video/tutorials/split-dedup.md
Path should be ce1_embd_parquet not iv2_embd_parquet

meta_parquet = os.path.join(OUT_DIR, "ce1_embd_parquet")

docs/curate-video/save-export.md
InternVideo2 directory references should be removed - only Cosmos-Embed1 is supported

- `ce1_embd/`: Per-clip embeddings (`.pickle`).
- `ce1_embd_parquet/`: Parquet batches with columns `id` and `embedding`.

docs/curate-video/save-export.md
InternVideo2 directory references should be removed

- When embeddings exist, the stage writes per-clip `.pickle` files under `ce1_embd/`.
- The stage also batches embeddings per clip chunk into Parquet files under `ce1_embd_parquet/` with columns `id` and `embedding` and writes those files to disk.

docs/curate-video/process-data/dedup.md
Should only reference ce1_embd_parquet/, not iv2_embd_parquet/

   - Parquet batches from `ClipWriterStage` under `ce1_embd_parquet/`

docs/curate-video/process-data/index.md
Should reference ce1_embd_parquet/ instead of iv2_embd_parquet/

Path helpers are available to resolve common locations (such as `clips/`, `filtered_clips/`, `previews/`, `metas/v0/`, and `ce1_embd_parquet/`).

@suiyoubi

suiyoubi commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e28aa0e

…embedding in total size calculation

Signed-off-by: Ao Tang <aot@nvidia.com>
@suiyoubi

suiyoubi commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b3afc96

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread tests/stages/video/io/test_clip_writer.py
@greptile-apps

greptile-apps Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (2)

nemo_curator/stages/video/io/clip_writer.py
These InternVideo2 helper methods should be removed as part of the purge.


docs/curate-video/save-export.md
Reference to InternVideo2 path helper should be removed from documentation.

ce1_parquet_dir = ClipWriterStage.get_output_path_ce1_embd_parquet(OUT)

Signed-off-by: Ao Tang <aot@nvidia.com>
@suiyoubi

suiyoubi commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ffe3801

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, 12 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (12)

docs/curate-video/save-export.md
iv2_embd/ and iv2_embd_parquet/ paths are no longer valid since InternVideo2 was removed. Update to only mention ce1_embd/ and ce1_embd_parquet/.


docs/curate-video/save-export.md
References to iv2_embd/ and iv2_embd_parquet/ paths should be removed - only ce1_embd/ paths exist now.


docs/curate-video/save-export.md
ClipWriterStage.get_output_path_iv2_embd_parquet() method no longer exists - this example code will fail. Remove this line.

ce1_parquet_dir = ClipWriterStage.get_output_path_ce1_embd_parquet(OUT)

docs/curate-video/tutorials/split-dedup.md
iv2_embd_parquet/ no longer exists. Update to only mention ce1_embd_parquet/.

The pipeline writes embeddings under `$OUT_DIR/ce1_embd_parquet/` when using Cosmos-Embed1.

docs/curate-video/tutorials/split-dedup.md
Directory listing shows iv2_embd_parquet/ which no longer exists. Update to ce1_embd_parquet/.

  ce1_embd_parquet/

docs/curate-video/tutorials/split-dedup.md
Example code references non-existent iv2_embd_parquet/ path. Update to ce1_embd_parquet/.

table = pq.read_table(f"{OUT_DIR}/ce1_embd_parquet")

docs/curate-video/tutorials/split-dedup.md
Example code references non-existent iv2_embd_parquet/ path. Update to ce1_embd_parquet/.

INPUT_PARQUET = f"{OUT_DIR}/ce1_embd_parquet"  # or s3://...

docs/curate-video/tutorials/split-dedup.md
Reference to iv2_embd_parquet should be removed.

  - Embeddings parquet: `${OUT_DIR}/ce1_embd_parquet`

docs/curate-video/tutorials/split-dedup.md
Example code references non-existent iv2_embd_parquet/ path. Update to ce1_embd_parquet/.

meta_parquet = os.path.join(OUT_DIR, "ce1_embd_parquet")

docs/curate-video/process-data/dedup.md
Reference to iv2_embd_parquet/ should be removed - only ce1_embd_parquet/ exists now.

   - Parquet batches from `ClipWriterStage` under `ce1_embd_parquet/`

docs/curate-video/process-data/dedup.md
Reference to iv2_embd_parquet/ should be removed.

Embeddings are written by the [`ClipWriterStage`](video-save-export) under `ce1_embd_parquet/`. For a runnable workflow, refer to the [Split and Remove Duplicates Workflow](video-tutorials-split-dedup).

docs/curate-video/process-data/index.md
Reference to iv2_embd_parquet/ should be removed from path helpers list.

Path helpers are available to resolve common locations (such as `clips/`, `filtered_clips/`, `previews/`, `metas/v0/`, and `ce1_embd_parquet/`).

@suiyoubi

suiyoubi commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4acdd10

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 66 to 68
def setup(self, worker_metadata: WorkerMetadata | None = None) -> None: # noqa: ARG002
self._iv2_embedding_buffer: list[dict[str, Any]] = []
self._ce1_embedding_buffer: list[dict[str, Any]] = []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] ClipWriterStage.setup() no longer initializes the removed IV2 buffer, but process() can call _write_clip_embedding_to_buffer() before setup() depending on how the stage lifecycle is used. Since _ce1_embedding_buffer is created in setup(), this would raise AttributeError if a caller invokes process() without calling setup() first. If the framework guarantees setup() is always called, it may be fine, but previously setup() was also where IV2 buffer was created and tests explicitly call it.

If you want this stage to be robust to direct use, consider initializing _ce1_embedding_buffer in __post_init__ or as a field default.

@greptile-apps

greptile-apps Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (1)

docs/curate-video/save-export.md
[P0] This doc still lists InternVideo2 embedding output dirs (iv2_embd/ and iv2_embd_parquet/) and references get_output_path_iv2_embd_parquet, but the PR removes those helpers/outputs from ClipWriterStage. This will mislead users and break copy/paste examples after InternVideo2 is purged.

Also appears in: docs/curate-video/process-data/dedup.md:21-23,88-90, docs/curate-video/process-data/index.md:127, docs/curate-video/tutorials/split-dedup.md:52-70,116-117,175-179,191-192.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r1.1.0 Pick this label for auto cherry-picking into r1.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants