Let K be a ÿeld of characteristic zero, let A, B be K-algebras with polynomial identity and let M be a free (A; B)-bimodule. The algebra R= A 0 M B can be endowed with a natural Z2-grading. In this paper, we compute the graded cocharacter sequence, the graded codimension sequence and the superexponent of R. As a consequence of these results, we also study the above PI-invariants in the setting of upper triangular matrices. In particular, we completely classify the algebra of 3 × 3 upper triangular matrices endowed with all possible Z2-gradings.