Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Lisa Ong 5aa080c110
Fixes for mixture of output and input_output parameters (#79)
* parameter value incorrectly set for affine array

* handle shape=() ndarrays in args verification

* test fix: order is not guaranteed(?)

* actually drop hash suffix

* .

* flag possible bug

* add helper to lookup function by name

* undo

Co-authored-by: Lisa Ong <onglisa@microsoft.com>
2022-11-01 10:29:08 +08:00
Kern Handa 610047e571
Updates HATPackage with addition of benchmak and func iterator (#77) 2022-10-10 11:51:52 -07:00
Kern Handa 8d4c04632b
Updates ArgValue to better handle constant sizes for runtime arrays (#72) 2022-10-04 12:57:54 -07:00
Kern Handa 12e9f2f7f8
Updates test requirements.txt (#73) 2022-09-28 14:14:26 -07:00
Lisa Ong 44badf7705
Function calls with runtime output arrays (#71)
* support partial dynamic sized runtime arrays

* marked TODO

* layout TODO

* fix

* expand arguments to include dimensions automatically

* remove accidental import

* working on correctness

* support calling dynamic sized functions

* return output arguments automatically

* add multi-output test

* nfc

* yapf

* allow output arrays to be passed as input args

* nfc

* support sharing of output dim args

* add check

* fix

* PR feedback

Co-authored-by: Lisa Ong <onglisa@microsoft.com>
2022-09-27 08:31:49 +08:00
Lisa Ong d99d61d970
Initial verify_hat support for runtime arrays and elements (#65)
* support arbirtary pointer levels for declared types

* handle logical_type=element

* arg values

* refactor (func name, arg_info) to FunctionInfo

* fix circular imports

* .

* support dylib

* update verify_hat_package

* verify -> verify_args

* fixes

* fix verify_args

* formatting

* add verify hat test

* refactor

* handle ndarrays as arguments

* cleanup

* runtime_array verify test

* print output

* basic test passing

* Update test_create_simple_hat_file.py

* Update test_create_simple_hat_file.py

* comments

* comments

* TODOs

* nfc

* [test] moved creation to workdir

* rename

* Print output dimension references and clarify HAT schema (#66)

* infer shapes from size, add shape order requirement

* merged

* pretty print using cross references

Co-authored-by: Lisa Ong <onglisa@microsoft.com>

* revert formatting changes

* revert more formatting only changes

* simplify

* Add input and input/output runtime_array support (#67)

* wip

* scaffold

* scaffold and initial support for input elements and input/output runtime_arrays

* .

* fixups

* don't swallow exceptions

* support cargs for non pointer args

* cleanup

* refactor

* support integer-like types when checking constant shapes

* nfc

Co-authored-by: Lisa Ong <onglisa@microsoft.com>

* test coverage for  usage type Input and InputOutput

* [test] Support windows in verify_hat tests (#69)

* wip

* build for windows (#68)

Co-authored-by: Lisa Ong <onglisa@microsoft.com>

* windows tomlkit expects lists

* manual CI trigger

Co-authored-by: Lisa Ong <onglisa@microsoft.com>

* fix windows test

* fix logic and add comment

* .

* verify_args -> verify

* args -> arguments

* PR feedback

Co-authored-by: Lisa Ong <onglisa@microsoft.com>
2022-08-23 07:09:25 +08:00
Lisa Ong fa6d727cf6
Add runtime output array sample and deserialization test (#60)
* removed duplicate test

* sample hat file for dynamic output arrays

* verify parsing of range sample

Co-authored-by: Lisa Ong <onglisa@microsoft.com>
2022-08-08 11:53:53 +08:00
Mason Remy 997e86a12f check for code string equivalence 2022-06-09 13:32:50 -07:00
Mason Remy efa2e7063c Make it easier to author a hat file from python
- Instantiate more default objects for simple cases
- Enable modifying the list of functions in the hat file
- Make hat file functions and function_map wrap the same underlying
  object
2022-06-09 01:05:07 -07:00
Lisa Ong 228c83f783
Fix shadowed time variable in benchmark_hat_package.py (#47)
* nfc

* shadowed variable time in python 3.7

* invoke perf_counter

* nfc

* add more checks now that exceptions are swallowed

* more stringent checks for benchmark tests

Co-authored-by: Lisa Ong <onglisa@microsoft.com>
2022-04-21 06:36:16 +08:00
Kern Handa 544fcc0e01
Refactors and restructures code for tighter integration of HAT object model (#36)
Changes:
* utility functions in `hatlib` now make use of the HAT object model (OM). Previously, `tomlkit` was being using directly and was bypassing the checks and OM construction of child objects.
* `hatlib.load` now returns a `HATPackage` object that results from deserializing the HAT file passed in. Additionally, if functions can be loaded, a non-empty `AttributeDict` is returned as a second value.
* Moved test folder to be a sibling of library folder. Now the package no longer contains the tests when installed. Additionally, the library can be tested by running `python -m unittest discover test` in the root of the repository.
* Adds YAPF style config to setup.cfg and formatted all touched files with `yapf`
2022-03-30 13:50:00 -07:00