Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A simple framework for automated testing of OpenCL kernels

Project description

Master of Kernel Testing

MOKT is a library for data-driven testing of OpenCL kernels. It obtains valid inputs and outputs from TensorFlow models — this way, you can easily get test data for a wide variety of machine learning operations, ranging from primitives such as ReLU and element-wise addition to whole subgraphs, e.g. ResNet's bottleneck blocks.

Installation

Install using pip:

pip install mokt

Note that only Python 3 is supported.

Usage

Check out examples to see MOKT in action.

Data extraction

It is recommended that you read the data extraction design note to get familiar with the way MOKT interacts with TensorFlow.

The high-level data API is used as follows:

@TestData(
    tf_checkpoint_dir='/path/to/checkpoint/dir',
    tf_values={'input': 'operation/name:0', 'output': 'another/op:0'})
def my_test_func(test_data):
    print(type(test_data['input'])) # <class 'numpy.ndarray'>

my_test_func()

Choosing the correct nodes for your tests is easier with TensorBoard, which visualizes the computational graph and shows helpful info, such as tensor shapes, operation names, etc.

Running OpenCL kernels

Execution is performed in a TestEnvironment, which conveniently wraps host state and handles data conversion (read the class documentation for more information).

You may of course choose to write your own specialized implementation and use this library for data extraction only.

Project details


Release history Release notifications

This version

0.9

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mokt, version 0.9
Filename, size File type Python version Upload date Hashes
Filename, size mokt-0.9-py3-none-any.whl (7.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mokt-0.9.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page