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

How to assign values to specific slice of a data block on a specific GPU? #324

Open
harshil-patel-code opened this issue Jun 3, 2021 · 0 comments

Comments

@harshil-patel-code
Copy link

Let's say I have following mesh structure.

flags.DEFINE_string('mesh_shape', 'rows:3, columns:4', 'mesh shape')
flags.DEFINE_integer('image_nx_block', 3, 'The number of x blocks.')
flags.DEFINE_integer('image_ny_block', 4, 'The number of y blocks.')
flags.DEFINE_string('layout', 'image_nx_block:rows, image_ny_block:columns', 'layout rules')

Basically, I have split rows and columns of a (1200, 1200) image into 3 and 4 blocks, respectively. These Blocks resides on a GPU mesh of 3x4. So, each block of size (400, 300) is assigned to an individual GPU. The mesh tensor (t) representing it will be of size (nx=3, ny=4, sx=400, sy=300). Now, I only want to change values in a specific slice in a specific block(s).

For example,
t(0, :, :, 0) = constant or
t(0, :, :, 0) = t(0, :, :, 1)

How do I perform this operation?

One way is use t_sy = mtf.slice(t, 0, 1, 'sy') but this gives slices from all GPUs. Further using, t_synx = mtf.slice(t_sy, 0, 1, 'nx') to reach to a specific GPU block throws an error: 'can't slice along split axis'.

Can someone please help here ?

@harshil-patel-code harshil-patel-code changed the title How to assign values to specific slice of a block on a specific GPU? How to assign values to specific slice of a data block on a specific GPU? Jun 3, 2021
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

No branches or pull requests

1 participant