@@ -282,15 +282,16 @@ def libpythonvm_build_args():
282282 vc = SUITE .vc
283283 commit = str (vc .tip (SUITE .dir )).strip ()
284284 branch = str (vc .active_branch (SUITE .dir , abortOnError = False ) or 'master' ).strip ()
285+ dsl_suffix = '' if not BYTECODE_DSL_INTERPRETER else '-bytecode-dsl'
285286
286287 if script := os .environ .get ("ARTIFACT_DOWNLOAD_SCRIPT" ):
287288 # This is always available in the GraalPy CI
288- profile = "cached_profile.iprof.gz"
289+ profile = f "cached_profile{ dsl_suffix } .iprof.gz"
289290 run (
290291 [
291292 sys .executable ,
292293 script ,
293- f"graalpy/{ commit } " ,
294+ f"graalpy/pgo { dsl_suffix } - { commit } " ,
294295 profile ,
295296 ],
296297 nonZeroIsFatal = False ,
@@ -299,21 +300,23 @@ def libpythonvm_build_args():
299300 # Locally, we try to get a reasonable profile
300301 get_profile = mx .command_function ('python-get-latest-profile' , fatalIfMissing = False )
301302 if get_profile :
302- for b in set ( [branch , "master" ]) :
303+ for b in [branch , "master" ]:
303304 if not profile :
304305 try :
305306 profile = get_profile (["--branch" , b ])
307+ if profile and dsl_suffix not in profile :
308+ mx .warn ("PGO profile seems mismatched, you need newer graal-enterprise" )
306309 except BaseException :
307310 pass
308311
309- if CI and not os .path .isfile (profile or "" ):
312+ if CI and ( not profile or not os .path .isfile (profile ) ):
310313 mx .log ("No profile in CI job" )
311314 # When running on a release branch or attempting to merge into
312315 # a release branch, make sure we can use a PGO profile, and
313316 # when running in the CI on a bench runner, ensure a PGO profile
314317 if (
315318 any (b .startswith ("release/" ) for b in [branch , os .environ .get ("TO_BRANCH" , "" )])
316- or ( ",bench," in os .environ .get ("LABELS" , "" ) )
319+ or os .environ .get ('BUILD_NAME' , '' ). startswith ( 'pybench-' )
317320 ):
318321 mx .warn ("PGO profile must exist for benchmarking and release, creating one now..." )
319322 profile = graalpy_native_pgo_build_and_test ()
@@ -361,10 +364,13 @@ def graalpy_native_pgo_build_and_test(args=None):
361364 GRAALPY_HOME = instrumented_home ,
362365 ):
363366 graalpytest (["--python" , instrumented_launcher , "test_venv.py" ])
364- mx .command_function ('benchmark' )(["meso-small:*" , "--" , "--python-vm" , "graalpython" , "--python-vm-config" , "custom" ])
365-
366- iprof_path = Path (SUITE .dir ) / 'default.iprof'
367- lcov_path = Path (SUITE .dir ) / 'default.lcov'
367+ python_vm_config = 'custom'
368+ if BYTECODE_DSL_INTERPRETER :
369+ python_vm_config += '-bc-dsl'
370+ mx .command_function ('benchmark' )(["meso-small:*" , "--" , "--python-vm" , "graalpython" , "--python-vm-config" , python_vm_config ])
371+ dsl_suffix = '' if not BYTECODE_DSL_INTERPRETER else '-bytecode-dsl'
372+ iprof_path = Path (SUITE .dir ) / f'default{ dsl_suffix } .iprof'
373+ lcov_path = Path (SUITE .dir ) / f'default{ dsl_suffix } .lcov'
368374
369375 run ([
370376 os .path .join (
@@ -411,17 +417,19 @@ def graalpy_native_pgo_build_and_test(args=None):
411417 mx .log (mx .colorize (f"[PGO] Gzipped profile at: { iprof_gz_path } " , color = "yellow" ))
412418
413419 if script := os .environ .get ("ARTIFACT_UPLOADER_SCRIPT" ):
420+ commit = str (SUITE .vc .tip (SUITE .dir )).strip ()
414421 run (
415422 [
416423 sys .executable ,
417424 script ,
418425 iprof_gz_path ,
419- str ( SUITE . vc . tip ( SUITE . dir )). strip () ,
426+ f"pgo { dsl_suffix } - { commit } " ,
420427 "graalpy" ,
421428 "--lifecycle" ,
422429 "cache" ,
423430 "--artifact-repo-key" ,
424431 os .environ .get ("ARTIFACT_REPO_KEY_LOCATION" ),
432+ '--skip-existing' ,
425433 ],
426434 )
427435
0 commit comments