Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding parallelization to "tfq.convert_to_tensor" for performance (#336)#793

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
redayzarra wants to merge3 commits intotensorflow:master
base:master
Choose a base branch
Loading
fromredayzarra:parallelization

Conversation

@redayzarra
Copy link

@redayzarraredayzarra commentedJul 13, 2023
edited
Loading

Overview

Hi, this is a draft pull request for improving thetfq.convert_to_tensor function by adding parallelization (#336). I'm confused about how the benchmarking suite works, so I am creating a draft pull request. For parallelization, I made sure to follow thePython documentation forconcurrent.futures and usedProcessPoolExecutor.

Since theconvert_item function is mostly CPU-bound and doesn't require heavy communication between processes, usingProcessPoolExecutor should provide a significant speed-up for large inputs.

I have simply added parallelization to thetfq.convert_to_tensor function and need help with benchmarking and testing.

Changes

Parallelization: usedconcurrent.futures.ProcessPoolExecutor to parallelize the conversion of items. Each item in the list is processed independently, which allows for significant speedup for converting large lists of items.

Docstrings: the original function had informative docstrings that described thetfq.convert_to_tensor function. I made sure to keep most of it and only added the necessary changes and fixed typos.

Concerns

I wasn't able to benchmark my changes or run unit tests. I tried my best to follow theContribution guidelines but ran into a lot of errors with Bazel. I am still working on the issue and wanted to inform you that the code has not been benchmarked using theBenchmark guidelines.

If the function needs to handle extremely deep nested lists, theconvert_item() function may need to be iterative rather than recursive. However, the original author already made a comment to dismiss this concern.

@mhuckamhucka added the area/performanceInvolves performance problems or improvements labelDec 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

area/performanceInvolves performance problems or improvements

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@redayzarra@mhucka

[8]ページ先頭

©2009-2025 Movatter.jp