The first part of the study is to evaluate and determine if three different forms of MGCD0103 (free base FB-MGCD0103, tartaric acid free base [TA-FB-MGCD0103], and dihydrobromide [2HBr] salt formulation MGCD0103) have the same properties when given to patients with cancer. The second part of the study is to determine whether MGCD0103 administered in combination with azacitidine is effective and safe in treating subjects with relapsed or refractory Hodgkin's lymphoma or non-Hodgkin's lymphoma (NHL) (follicular or diffuse large B-cell [DLBCL]).