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

Bug report #132

Open
scampanoni opened this issue Mar 12, 2019 · 3 comments
Open

Bug report #132

scampanoni opened this issue Mar 12, 2019 · 3 comments

Comments

@scampanoni
Copy link

scampanoni commented Mar 12, 2019

I'm afraid I might have found a bug in opentuner.

Next is a small code that highlights the issue.

===== Code ====
#!/usr/bin/env python
import sys
import adddeps # fix sys.path

import opentuner
from opentuner import ConfigurationManipulator
from opentuner import IntegerParameter
from opentuner import MeasurementInterface
from opentuner import Result

class autotuneProgram(MeasurementInterface):

def manipulator(self):
sys.stderr.write('AUTOTUNER: Create the design space\n')
manipulator = ConfigurationManipulator()
openTuner_param = IntegerParameter('1', 0, 10000)
manipulator.add_parameter(openTuner_param)
openTuner_param = IntegerParameter('2', 0, 10000)
manipulator.add_parameter(openTuner_param)
openTuner_param = IntegerParameter('3', 0, 10000)
manipulator.add_parameter(openTuner_param)
return manipulator

def run(self, desired_result, input, limit):
cfg = desired_result.configuration.data
sys.stderr.write('AUTOTUNER: ' + str(cfg) + '\n')
return Result(time=3.5)

def save_final_config(self, configuration):
sys.stderr.write('AUTOTUNER: END')

if name == 'main':
argparser = opentuner.default_argparser()
autotuneProgram.main(argparser.parse_args())

====== Error message ====
The above code quickly results in the following error message:
sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) Can't resolve value for column configuration.id on object <Configuration at 0x2ab22fc706d0>; no value has been set for this column
[SQL: SELECT count(*) AS count_1
FROM (SELECT result.id AS result_id, result.configuration_id AS result_configuration_id, result.machine_id AS result_machine_id, result.input_id AS result_input_id, result.tuning_run_id AS result_tuning_run_id, result.collection_date AS result_collection_date, result.collection_cost AS result_collection_cost, result.state AS result_state, result.time AS result_time, result.accuracy AS result_accuracy, result.energy AS result_energy, result.size AS result_size, result.confidence AS result_confidence, result.was_new_best AS result_was_new_best
FROM result
WHERE ? = result.tuning_run_id AND ? = result.configuration_id) AS anon_1]
[parameters: [{}]]

@jbosboom
Copy link
Collaborator

I don't see anything obviously wrong with your tuner.

What version of sqlalchemy are you using? (New feature version 1.3.0 was released earlier this month and might be responsible for problems in the database layer.)

@scampanoni
Copy link
Author

I'm using SQLAlchemy 1.3.1.

Should I switch to an older version?

Thanks,
Simone

@hfp
Copy link

hfp commented Apr 18, 2019

Same problem here. I used SQLAlchemy 1.2.19 and it works. Please note, both 1.3.x and 1.2.x are releases mentioned as current. Perhaps 1.2.x is more stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants