Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Fully Inlined call function, call-backward function. #120

Merged
merged 51 commits into from
Apr 2, 2023
Merged

Conversation

hikettei
Copy link
Owner

@hikettei hikettei commented Apr 2, 2023

  1. Optimized the overhead of call-forward/call-backward.
    All the generic functions are abandoned and now they're fully inlined.

Example:
image

That is, optimizing codes in cl-waffe has become very easy.
Various arguments were added to defnode accordingly.

:disassemble-forward 
:forward-declaim
:forward

:disassemble-backward 
:backward-declaim
:backward
(defnode ScalarSub ()
  :disassemble-forward t
  :forward-declaim (declaim (ftype (function (ScalarSub waffetensor waffetensor) waffetensor) :forward))
  :forward ((x y)
	    (let ((x (data x))
		  (y (data y))) ; todo: define with typevar
	      (declare (type single-float x y))
	      (const (- x y))))
  :backward ((dy) (list dy dy)))

TODO:

  1. The defnode has been changed, but the standard implementation functions have not yet been optimised.
  2. The main causes of overheads now are kernel.lisp And I need to optimise here.
  3. Update Documentations.

⚠️ Some APIs are changed (e.g.: call now becomes macros), However, I don't have much time to update the documentations. So Documentation and API may differ.

@hikettei hikettei merged commit 6014569 into main Apr 2, 2023
This was referenced Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant