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

Support explicit dataset shard? #47

Open
pengyuan opened this issue Jan 4, 2021 · 1 comment
Open

Support explicit dataset shard? #47

pengyuan opened this issue Jan 4, 2021 · 1 comment
Labels
question Further information is requested

Comments

@pengyuan
Copy link

pengyuan commented Jan 4, 2021

when tensorflow read dataset from kafka, how to implement each partition read by one worker?

something like hovorod:
a. get the total worker number and worker index by rank()
b. then apply shard() method in tensorflow

@zhangys-lucky
Copy link
Collaborator

here has a demo: examples/common/util.py

dataset = ds_data_files.shard(num_shards=tn.core.shard_num(), index=tn.core.self_shard_id())

@zhangys-lucky zhangys-lucky added the question Further information is requested label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants