Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livepeer AI Subnet #2959

Merged
merged 278 commits into from
Nov 7, 2024
Merged

Livepeer AI Subnet #2959

merged 278 commits into from
Nov 7, 2024

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Jan 23, 2024

This PR introduces the AI features into go-livepeer.

Original comment from Yodon

Opening this draft PR to kick off CI build process for the WIP ai-video branch. This PR should not be merged as-is and the code on this branch will likely be refactored + cleaned up separately later on.

@yondonfu yondonfu changed the title [WIP] AI Video prototype [WIP] AI video prototype Jan 23, 2024
@yondonfu yondonfu force-pushed the ai-video branch 5 times, most recently from feb3f3e to 563d199 Compare January 24, 2024 16:53
@yondonfu
Copy link
Member Author

yondonfu commented Jan 24, 2024

d32b1b5 temporarily disables Linux arm64 builds because they fail due to an error related to not being able to find zlib during ffmpeg compilation. This error doesn't occur for amd64 builds so I suspect the issue is related to the amd64 -> arm64 cross-compilation process. I noticed that we compile an arm64 specific version of x264 before compiling ffmpeg - perhaps we have to do something similar with zlib?

zlib is currently required as a dependency as of 133050d#diff-4ae778054809274731b9da0c6a5a869c0bd214e92f954a5c9c39181748c2f175 which enabled the png decoder and image2 muxer which are used to demux + decode a sequence of PNG files so they can be encoded into an mp4 file. Ideally, we would replace the PNG demux/decode component by passing tensors (that represent frames) outputted by a model directly from GPU memory to NVENC using torchaudio.StreamWriter, but torchaudio.StreamWriter doesn't support RGB -> YUV conversion on the GPU yet - it can still encode a larger, less-streaming friendly (my understanding is yuv420p is preferred for streaming) RGB output, but I didn't jump to implement this yet due to current limitations. Until this replacement happens, zlib would be a required dependency to support the temporary PNG demux + decode component.

@iameli
Copy link
Contributor

iameli commented Jan 24, 2024

@yondonfu Weird - on release go-livepeer right now zlib is dynamically linked. I'll have a look.

@leszko leszko changed the title [WIP] AI video prototype Livepeer AI Subnet Nov 6, 2024
@leszko leszko marked this pull request as ready for review November 6, 2024 08:30
server/ai_http.go Dismissed Show dismissed Hide dismissed
server/ai_worker.go Dismissed Show dismissed Hide dismissed
server/ai_worker.go Dismissed Show dismissed Hide dismissed
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 19.86279% with 4906 lines in your changes missing coverage. Please review.

Project coverage is 34.96839%. Comparing base (f20d1ff) to head (0a56bd1).
Report is 279 commits behind head on master.

Files with missing lines Patch % Lines
server/ai_process.go 0.61350% 1133 Missing and 1 partial ⚠️
core/ai_worker.go 32.08020% 527 Missing and 15 partials ⚠️
server/ai_http.go 12.74900% 434 Missing and 4 partials ⚠️
trickle/trickle_server.go 0.00000% 319 Missing ⚠️
server/ai_session.go 2.51799% 271 Missing ⚠️
server/ai_mediaserver.go 11.18644% 255 Missing and 7 partials ⚠️
net/lp_rpc.pb.go 9.48905% 247 Missing and 1 partial ⚠️
cmd/livepeer/starter/starter.go 13.33333% 245 Missing and 2 partials ⚠️
server/ai_worker.go 49.89059% 198 Missing and 31 partials ⚠️
media/rtmp2segment.go 0.00000% 203 Missing ⚠️
... and 31 more
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##              master       #2959          +/-   ##
====================================================
- Coverage   56.71558%   34.96839%   -21.74719%     
====================================================
  Files             92         135          +43     
  Lines          19693       35901       +16208     
====================================================
+ Hits           11169       12554        +1385     
- Misses          7917       22641       +14724     
- Partials         607         706          +99     
Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
common/types.go 0.00000% <ø> (ø)
core/streamdata.go 59.79381% <ø> (ø)
discovery/db_discovery.go 70.26022% <100.00000%> (ø)
discovery/discovery.go 92.12598% <100.00000%> (ø)
discovery/stub.go 84.44444% <100.00000%> (+0.72351%) ⬆️
server/mediaserver.go 67.60886% <100.00000%> (+0.07440%) ⬆️
server/ot_rpc.go 35.77982% <100.00000%> (-0.61162%) ⬇️
server/selection.go 93.52518% <100.00000%> (-0.04625%) ⬇️
server/webserver.go 95.83333% <100.00000%> (+0.04386%) ⬆️
... and 41 more

... and 19 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f20d1ff...0a56bd1. Read the comment docs.

Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
common/types.go 0.00000% <ø> (ø)
core/streamdata.go 59.79381% <ø> (ø)
discovery/db_discovery.go 70.26022% <100.00000%> (ø)
discovery/discovery.go 92.12598% <100.00000%> (ø)
discovery/stub.go 84.44444% <100.00000%> (+0.72351%) ⬆️
server/mediaserver.go 67.60886% <100.00000%> (+0.07440%) ⬆️
server/ot_rpc.go 35.77982% <100.00000%> (-0.61162%) ⬇️
server/selection.go 93.52518% <100.00000%> (-0.04625%) ⬇️
server/webserver.go 95.83333% <100.00000%> (+0.04386%) ⬆️
... and 41 more

... and 19 files with indirect coverage changes

rickstaa and others added 6 commits November 6, 2024 15:13
This commit removes redundant code in the AI orchestrator server file (i.e. `ai_http.go`) to increase code readability.
This commit updates the ai-worker go dependency to version v0.12.1.
This commit ensures that the I2V temporary files created during transcoding are removed after the object storage is successfully created by the orchestrator.
This commit ensures that the VERSION file is updated so that the version capability constraint works.
@leszko leszko merged commit 58a64dc into master Nov 7, 2024
22 checks passed
@leszko leszko deleted the ai-video branch November 7, 2024 08:26
@rickstaa rickstaa restored the ai-video branch November 13, 2024 21:46
@rickstaa rickstaa deleted the ai-video branch November 13, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.