Conversation
…uivalents The Photon-to-Spark mapping is one file, parser/photon/databricks-13_3.json, loaded for every runtime. A Photon name with no entry falls through the generic parser as an unsupported exec. On a 17.3 Delta MERGE log seven of the 21 Photon node names have no entry and are reported Unsupported, Triage in 39 of 121 SQLs, the write pair under an Execute WriteIntoDeltaCommand the tools already recognise. Seven additive entries: PhotonWriteStage to WholeStageCodegen like the other stage wrappers, PhotonParquetWriter to WriteFiles, PhotonMetadataSubquery and PhotonRuntimeFilterSource to Subquery (removed from the estimate, as GenerateBloomFilter is on EMR), PhotonColumnarToRow to ColumnarToRow, PhotonRange to Range, PhotonJsonScan to Scan. A 13.3 plan never contains these names, so the 13.3 fixture and its expectations are unchanged, and NVIDIA#1384 stays for a mapping that diverges between runtimes. Test: PhotonPlanParserSuite pins each entry through PhotonOssOpMapper.mapContentToOss with the expected name written out. It fails on dev and passes with the change (2 succeeded), scalastyle clean. On the 17.3 log the seven names leave the unsupported report (71 rows to 0), the unsupported stage share moves from 49.26% to 28.45% and the estimate from 1.05x to 1.15x. Fixes NVIDIA#2158 Signed-off-by: Thomas Wynne <jtwynne3@gmail.com>
|
amahussein
left a comment
There was a problem hiding this comment.
Thanks @jtwynne for the changes!
IIRC, there is a tricky part in adding photon ops. We need to take a deeper look on those new ops and their metrics.
Otherwise, the metrics won't be aggregated correctly.
The starting point is to take a deeper look at a photon eventlog Vs its Spark equivalent eventlog.
CC: @parthosa @mattahrens
|
@amahussein I ran the comparison. Same MERGE workload on plain 17.3 (the gpu-ml runtime with no plugin and no Photon) next to the Photon log the PR came from, every metric name per node pulled from both, then checked against what each mapped parser reads.
The two subquery nodes are the only ones whose metrics don't match the parser they land on, and they're also the two with nothing to compare against. No Stage level on the Photon log, same jar with and without the change, 190 stages, task totals identical: 40 stages move, 38 down and 2 up. The write stages go to 0 unsupported (12: 93,060 to 0, 453: 126,099 to 0), the runtime-filter stages roughly halve as two Photon rows become one The 2 that go up are the tricky part you were remembering, I think. Stages 456 (723 to 1,012) and 301 (286 to 400) hold an unsupported So the mapping holds up on metrics, and the stage boundary for Photon clusters is a separate defect in the graph builder that predates it. I submitted that as a new issue in #2161 with the fixture counts, and the fix (close a Photon cluster at the Exchange-mapped input, or apportion cluster children by their own stages) probably belongs in its own PR with its own test. So, I've kept this one as the mapping change, with that as the follow-up. |
Fixes #2158
Problem
On a Databricks 15.4 or 17.3 Photon event log,
spark_rapids qualificationlists Photon nodesthat did not exist on 13.3 as unsupported execs,
Exec, Unsupported, Triageinunsupported_operators.csv. The Photon-to-Spark mapping is one file,parser/photon/databricks-13_3.json, loaded byPhotonOssOpMapperfor every runtime. A Photonname with no entry is left as it is and the generic parser reports it as unsupported. On a 17.3
Delta MERGE log, seven of the 21 Photon node names have no entry (
PhotonWriteStage,PhotonParquetWriter,PhotonMetadataSubquery,PhotonRuntimeFilterSource,PhotonColumnarToRow,PhotonRange,PhotonJsonScan) and they land in 39 of 121 SQLs:The write pair sits under
Execute WriteIntoDeltaCommand, which the tools already recognise,so the command is scored while its own writer counts against it. The file's header carries a
TODO for per-version files and #1384 asks for the same.
Fix
Seven entries in
databricks-13_3.json, each the Spark node the tools already score or setaside, the way the existing entries map Photon's stage wrappers and scans.
PhotonWriteStage -> WholeStageCodegen, asPhotonShuffleMapStage,PhotonResultStageandPhotonUnionShuffleMapStagealready do.PhotonParquetWriter -> WriteFiles, the physicalwriter under the write command (
WriteFilesExecinsupportedExecs.csv, and one of thesupported blank execs).
PhotonMetadataSubquery -> SubqueryandPhotonRuntimeFilterSource -> Subquery. Both arepointer nodes: in the log each has zero exec duration and no children and sits inside the
scan's own stage, whose time is scored through the scan and filter. That is the shape
SubqueryExecParserdescribes ("a collect execution pointing to an actual one", driver-sidemetrics) and removes from the estimate, and it is where the OSS forms of the same two things
land, a runtime filter being a bloom-filter aggregate subquery and metadata pruning a
dynamic-pruning subquery. EMR's
GenerateBloomFiltergets the same treatment onexecsToBeRemoved.SubqueryBroadcastwould instead count a Photon-only filter build assupported work, so it was not used. With the mapping these rows reappear as
SubqueryunderIgnoreNoPerf and the stage time stays with the scans. This is the one judgment call in the
set.
PhotonColumnarToRow -> ColumnarToRow(also onexecsToBeRemoved),PhotonRange -> Range(
RangeExec),PhotonJsonScan -> Scan, which keeps the format suffix the wayPhotonScandoes and gives the read parser
Scan json.and its expectation files are unchanged. None of the seven means something different on
another runtime, so this does not pre-empt [FEA] Implement Version-Specific Photon to Spark Node Mapping for Photon parsing #1384, which stays for a mapping that diverges.
The file keeps its name, since renaming it touches
PhotonOssOpMapperand the design in[FEA] Implement Version-Specific Photon to Spark Node Mapping for Photon parsing #1384.
PhotonOssOpMapper.toPlatformAwarePlan.Tests
PhotonPlanParserSuite, "Photon operators from Databricks 15.4 and 17.3 map to their Sparkequivalents": one assertion per entry with the expected name written out, through
PhotonOssOpMapper.mapContentToOss, plusPhotonJsonScan json -> Scan jsonand an unmappedname left unchanged. Fails on
devat its first pin,"[PhotonWriteStage]" did not equal "[WholeStageCodegen]". The existing 13.3 log test in the suite is unchanged and stillpasses. No log fixture is added: the 17.3 log is far
above the suite's largest fixture, and the mapping is a name substitution the string test
exercises directly.
PhotonPlanParserSuite: 2 succeeded, 0 failed with the change. Scalastyle clean.leave
unsupported_operators.csv(71 rows over 39 SQLs to 0), the unsupported stage sharemoves from 49.26% to 28.45%, the estimated speedup from 1.05x to 1.15x, and
execs.csvshowsWriteFiles,Subquery,RangeandScan jsonwhere the Photon names were. The 71 Triagerows become 32 rows under ignore actions, 28
Subqueryand 3ColumnarToRowasIgnoreNoPerf and the JSON scan as a
ReadDeltaLogIgnorePerf (it is the Delta log read),none of which counts toward the estimate. The other 721 rows are unchanged. The app stays
Not Recommended on the share that remains, which is the Delta commands and the rest of the
plan, not these nodes.