apyfal.client

Accelerator Client

class apyfal.client.AcceleratorClient(accelerator=None, client_type=None, accelize_client_id=None, accelize_secret_id=None, config=None, **_)[source]

REST accelerator client.

Parameters:
  • accelerator (str) – Name of the accelerator to initialize.
  • client_type (str) – Type of client.
  • accelize_client_id (str) – Accelize Client ID.
  • accelize_secret_id (str) – Accelize Secret ID.
  • config (apyfal.configuration.Configuration, path-like object or file-like object) – If not set, will search it in current working directory, in current user “home” folder. If none found, will use default configuration values. Path-like object can be path, URL or cloud object URL.
DEFAULT_AUTHORIZED_HOST_DIRS = ['~/shared']

Default directories that can be processed remotely on host

DEFAULT_CONFIGURATION_PARAMETERS = {'app': {'enable-sw-comparison': 0, 'logging': {'format': 1, 'verbosity': 2}, 'reload': True, 'reset': False, 'specific': {}}, 'env': {}}

Default parameters JSON for configuration/start stage

DEFAULT_PROCESS_PARAMETERS = {'app': {'enable-sw-comparison': 0, 'logging': {'format': 1, 'verbosity': 4}, 'reset': False, 'specific': {}}}

Default parameters JSON for process stage

as_tmp_file(url, mode)[source]

Return temporary representation of a file.

Parameters:
  • url (str) – apyfal.storage URL of the file.
  • mode (str) – Access mode. ‘r’ or ‘w’.
Returns:

temporary object.

Return type:

str or file-like object

name

Accelerator name

Returns:name
Return type:str
process(src=None, dst=None, info_dict=None, **parameters)[source]

Processes with accelerator.

Parameters:
  • src (path-like object or file-like object) – Source data to process. Path-like object can be path, URL or cloud object URL.
  • dst (path-like object or file-like object) – Processed data destination. Path-like object can be path, URL or cloud object URL.
  • parameters (path-like object, str or dict) – Accelerator process specific parameters Can also be a full process parameters dictionary (Or JSON equivalent as str literal) Parameters dictionary override default configuration values, individuals specific parameters overrides parameters dictionary values. Take a look to accelerator documentation for more information on possible parameters. Path-like object can be path, URL or cloud object URL.
  • info_dict (dict or None) – If a dict passed, this dict is updated with extra information from current operation.
Returns:

Result from process operation, depending used accelerator.

start(src=None, info_dict=None, host_env=None, reload=None, reset=None, **parameters)[source]

Configures accelerator.

Parameters:
  • src (path-like object or file-like object) – Depending on the accelerator, a configuration data need to be loaded before a process can be run. Path-like object can be path, URL or cloud object URL.
  • parameters (str, path-like object or dict) – Accelerator configuration specific parameters Can also be a full configuration parameters dictionary (Or JSON equivalent as str literal or apyfal.storage URL to file) Parameters dictionary override default configuration values, individuals specific parameters overrides parameters dictionary values. Take a look to accelerator documentation for more information on possible parameters. Path-like object can be path, URL or cloud object URL.
  • reload (bool) – Force reload of FPGA bitstream.
  • reset (bool) – Force reset of FPGA logic.
  • info_dict (dict or None) – If a dict passed, this dict is updated with extra information from current operation.
  • host_env (dict) – Overrides Accelerator “env”.
stop(info_dict=None, full_stop=True)[source]

Stop accelerator.

Parameters:
  • full_stop (bool) – If True, send stop request to accelerator application. If False only clean up accelerator client environment.
  • info_dict (dict or None) – If a dict passed, this dict is updated with extra information from current operation.