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

Improve some CSV integration tests [databricks] #9146

Merged
merged 8 commits into from
Sep 28, 2023

Conversation

andygrove
Copy link
Contributor

Some of the CSV integration tests need to allow some operators to fallback because, in some cases, the CPU scans the file before the GPU does (such as when inferring the schema). However, these tests were then invoking assert_gpu_and_cpu_are_equal_collect without verifying that anything ran on the GPU, meaning that the tests were not really testing what they needed to, and regressions could go undetected.

This PR aims to address that by calling assert_cpu_and_gpu_are_equal_collect_with_capture instead, and confirming that the expected operator ran on the GPU.

@andygrove andygrove self-assigned this Aug 30, 2023
@andygrove andygrove added task Work required that improves the product but is not user facing test Only impacts tests labels Aug 30, 2023
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove changed the title WIP: Improve some CSV integration tests Improve some CSV integration tests Aug 30, 2023
@andygrove andygrove marked this pull request as ready for review August 30, 2023 20:33
gerashegalov
gerashegalov previously approved these changes Sep 6, 2023
Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending CI

Comment on lines 555 to 556
# TODO this does not confirm that this scan actually runs on GPU, but I am not
# sure if we can capture the plan with a COUNT, since it normally requires a COLLECT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let us file an issue and maybe reference it in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gerashegalov . I have filed #9199 and updated the comment.

@andygrove
Copy link
Contributor Author

build

Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we run this on databricks too? Just because that is one place where we often see them plan thing differently.

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lambda spark : spark.read.schema(gen.data_type)\
.csv(data_path)\
.filter(f.col('a') > 0)\
.selectExpr('a',
'input_file_name()',
'input_file_block_start()',
'input_file_block_length()'),
cpu_fallback_class_name = 'FileSourceScanExec' if v1_enabled_list == 'csv' else 'BatchScanExec',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a must-fix, stylistically and because in a future the parameter v1_enabled_list might become a comma-separated value or a Python list we might want to check for 'csv' in v1_enabled_list rather than equality.

@andygrove andygrove changed the title Improve some CSV integration tests Improve some CSV integration tests [databricks] Sep 27, 2023
@andygrove
Copy link
Contributor Author

build

@andygrove andygrove merged commit 7d5b904 into NVIDIA:branch-23.10 Sep 28, 2023
29 checks passed
@andygrove andygrove deleted the csv-test-improvements branch September 28, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing test Only impacts tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants