Our prayer comes from the The Great Liberation by Hearing in the Intermediate States [English title: Tibetan Book of the Dead], composed by Padmasambhava, revealed by Karma Lingpa, translated by Gyurme Dorje, edited by Graham Coleman with Thupten Jinpa), introductory commentary by His Holiness the Dalai Lama.
This particular version contains extra material, including Chapter 1 which introduces preliminary practices. Authorship of these preliminary practices is attributed to Nyinda Choje, Karma Lingpa's son and first lineage holder; they were said to have been written down by Lama Nyinda Ozer, the second lineage holder. The editor's introduction to our Kye Ma Kye Hud song gives:
In its original Tibetan this preliminary practice is beautifully written in verse. In the monasteries and lay households of the practitioners of this cycle of teachings, it is usually sung melodically in the early morning, before any other practice or activity is begun. Often the young monks sing the opening verses of this poem as they go about their morning duties.
I'm so glad you asked the question - it's good to have found out more about one of my favorite songs!