Skip to content

Commit

Permalink
fix softmax?
Browse files Browse the repository at this point in the history
  • Loading branch information
hikettei committed Feb 7, 2025
1 parent c01c7ed commit 77a56b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/codegen/blueprint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,12 @@ Depends=~a Reduce=~a Users=~a
(setf (node-writes node) (list (gensym "TMP")))
(return-from lower-item (emit (%setf aref (emit node) :out id)))))
;; Also insert %setf if the node is an output of the schedule-item.
(when (find (car (node-writes node)) (node-writes schedule-item))
(when (or
(find (car (node-writes node)) (node-writes schedule-item))
(> (buffer-nrank (car (relay-writes (read-type-relay node)))) 0))
(when (null (find (car (node-writes node)) (node-writes schedule-item)))
;; Insert a %global as a temporary buffer
(%global (car (node-writes node)) (buffer-dtype (car (relay-writes (read-type-relay node)))) t))
(assert (null (getattr node :reduction :allow-undefined t)) () "The node ~a cannot be a reduction node." node)
(let* ((type (read-type-relay node))
(aref (if (> (buffer-nrank (car (relay-writes type))) 0)
Expand Down

0 comments on commit 77a56b9

Please sign in to comment.