-
Notifications
You must be signed in to change notification settings - Fork 629
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
Remove MakeContiguous before CPU inputs of GPU ops. #5590
Conversation
…and errneous checks in workspace_policy. Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
TEST_F(PipelineTestOnce, TestTriggerToContiguous) { | ||
RunTestTrigger("cpu"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test checked for the presence of the feature we've just removed.
8e3385f
to
1524201
Compare
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [17143006]: BUILD STARTED |
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [17143849]: BUILD STARTED |
if (device == "gpu" && separated_execution_) | ||
SetupCPUInput(it, input_idx, &spec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced a delay in Executor RunGPU (in different places) and tested it with the following code:
@params((2, 5), (5, 2))
def test_separated_queues(cpu_queue_depth, gpu_queue_depth):
data = [np.array((10 * (i + 1)), dtype=np.float32) for i in range(10)]
@pipeline_def(batch_size=1, num_threads=1, device_id=0)
def pipe():
inp = fn.external_source(data, batch=False, cycle=True) + 0
img = types.Constant(np.zeros(shape=(1,1,3), dtype=np.uint8)).gpu()
return fn.resize(img, resize_x=inp, resize_y=1) # pass argument input to resize_x
p = pipe(prefetch_queue_depth={"cpu_size":cpu_queue_depth, "gpu_size":gpu_queue_depth})
p.build()
for i in range(10):
o, = p.run()
assert o[0].shape()[1] == data[i]
The results were correct, so this seems not necessary now (I wonder if it ever was).
I'm not adding this test to our regular tests, because it's of little value without the delays (which we certainly don't want to add).
CI MESSAGE: [17143849]: BUILD PASSED |
Category:
Refactoring (Redesign of existing code that doesn't affect functionality)
Description:
Before the unification of TensorList it was necessary to insert a MakeContiguous operator between CPU and other backends because TensorVector needed to be converted to TensorList. It's no longer the case and the operation is superfluous.
The checks used a no-op function in workspace_policy now kicked in and created an invalid workspace - they are no longer necessary and were removed.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
test_pipeline.py - all of it
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-4030