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

Cannot handle mutiple loop tranformation within a single /@* Loop clause #11

Open
amit56r opened this issue Jul 14, 2015 · 2 comments
Open
Assignees
Labels

Comments

@amit56r
Copy link
Collaborator

amit56r commented Jul 14, 2015

Refer to code spapt -> {LU,Correlation,stencil3d} anything with multiple nested loops to be transformed. The error reported is

debug output (in orio) for LU kernel:

5415
200
200
[0, 185, 183, 23, 144, 85, 68, 73, 115, 95]
{'U2_I': 1, 'U2_J': 1, 'U1_J': 1, 'RT2_J': 1, 'T2_Ia': 1, 'T2_J': 1, 'T2_I': 1, 'T2_Ja': 1, 'RT2_I': 1}
DEBUG[OptDriver]:__optimizeCodeFrag: code_frag type is NonAnn
DEBUG[OptDriver]:OptDriver line 79
DEBUG[OptDriver]:__optimizeCodeFrag: code_frag type is AnnCodeRegion
DEBUG[OptDriver]:OptDriver line 85: Loop
DEBUG[OptDriver]:OptDriver line 114, detected code annotated for tuning
DEBUG[OptDriver]:__optimizeCodeFrag: code_frag type is NonAnn
DEBUG[OptDriver]:OptDriver line 79
DEBUG[OptDriver]:about to load module.class orio.module.loop.loop.Loop corresponding to annotation Loop
DEBUG[OptDriver]:about to instantiate transformation class: orio.module.loop.loop.Loop
DEBUG[OptDriver]:successfully instantiated transformation class: orio.module.loop.loop.Loop
ERROR: orio.main.opt_driver: encountered an error during transformation _<orio.module.loop.loop.Loop instance at 0x22f9f80>:
ForStmt instance has no attribute 'name'
_
File "/home/aroy/pkg/orio/bin/orcc", line 27, in
orio.main.orio_main.start(sys.argv, orio.main.orio_main.C_CPP)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/orio_main.py", line 109, in start
optimized_code_seq = odriver.optimizeCodeFrags(cfrags, True)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/opt_driver.py", line 44, in optimizeCodeFrags
cur_seq = self.__optimizeCodeFrag(cf, perf_params)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/opt_driver.py", line 118, in __optimizeCodeFrag
cfrag.cfrags)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/tuner/tuner.py", line 151, in tune
best_perf_params, best_perf_cost = search_eng.search()
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/tuner/search/search.py", line 111, in search
best_coord,best_perf,search_time,runs = self.searchBestCoord(startCoord)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/tuner/search/randomsearch/randomsearch.py", line 164, in searchBestCoord
perf_costs = self.getPerfCosts([coord])
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/tuner/search/search.py", line 254, in getPerfCosts
transformed_code_seq = self.odriver.optimizeCodeFrags(self.cfrags, perf_params)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/opt_driver.py", line 44, in optimizeCodeFrags
cur_seq = self.__optimizeCodeFrag(cf, perf_params)
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/opt_driver.py", line 196, in __optimizeCodeFrag
err('orio.main.opt_driver: encountered an error during transformation %s:\n %s' % (transformation,e))
File "/nfs2/aroy/pkg/orio/lib/python2.7/site-packages/orio/main/util/globals.py", line 314, in err
traceback.print_stack()

@amit56r amit56r added the bug label Jul 14, 2015
brnorris03 added a commit that referenced this issue Jul 14, 2015
…ionbecause Orio needs to see its index variable in the body. Similar fixes should be implemented for other examples that give this error.
@brnorris03
Copy link
Owner

See example fix in a335d78, something similar has to be done for the rest of the examples that have this problem.

@amit56r
Copy link
Collaborator Author

amit56r commented Jul 15, 2015

Alternative fix: (for future reference)

  • move all loops that are not being transformed outside the /*@ begin Loop Block
  • Separate loops into multiple /*@ begin Loop Blocks.

i.e

/*@ begin Loop (

transform composite(...)
nested Loop1

transform composite(...)
nested Loop2

)
becomes -->

/*@ begin Loop (

transform composite(...)
nested Loop1

)

/*@ begin Loop (

transform composite(...)
nested Loop2

)

@amit56r amit56r self-assigned this Jul 15, 2015
brnorris03 added a commit that referenced this issue Mar 8, 2017
* origin/HEAD: (64 commits)
  MIT license
  bug fixes
  cudacfg
  working cudacfg search prototype
  everything except actual coordinate selection model is now working.
  debugging mostly
  instruction mix lookup implementation (in progress)
  new module code, not done yet (need to add time lookup)
  Static model-driven search module added (cudacfg); work in progress
  metadata parameters for loop info (minor addition)
  added power section to tuning spec
  Make measurement more extensible; add initial power measurement code in template.
  initialize cmdline_info
  new command-line arguments syntax
  fixed uninitialzed var
  the rest of command-line option handling
  command line options added to tuning spec and search; still to do: actually use them in running test
  Example fix for #11, the outer loop should NOT be outside the annotationbecause Orio needs to see its index variable in the body. Similar fixes should be implemented for other examples that give this error.
  don't store eclipse metadata in repo
  ATAX BicG kernels.
  ...

# Conflicts:
#	orio/main/cmd_line_opts.py
#	orio/main/opt_driver.py
#	orio/main/tuner/search/exhaustive/exhaustive.py
#	orio/main/tuner/search/extern/extern.py
#	orio/main/tuner/search/randomsearch/randomsearch.py
#	orio/main/tuner/search/search.py
#	orio/main/util/globals.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants